Memory Leak

P

phil89

Hi,

I have an big applet with 130ko into mémory, when i leave my applet
page browser don't give me memory . So after many applet calling
memory is full ?

How could i force browser to free memory when i leave applet page ?

Regards
Philippe
 
J

John B. Matthews

Lew said:
phil89 said:
130k [bytes of]

I think most of us know what "ko" (kilo-octets) means, and that it's actually
more precise than "kbytes", since a byte need not necessarily be eight bits
but an octet must be. Thanks for the elucidation anyway, though.

Aha! Thanks. I overlooked the correct interpretation, but I always enjoy
learning something new:

<http://en.wikipedia.org/wiki/Octet_(computing)>

The implementation dependence of bits-per-byte is fundamental in Ada
(System.Storage_Unit), so I should know better:

<http://www.adaic.com/standards/05rm/html/RM-13-7.html>

Even with the best intentions, Murphry's Law applies:

<http://home.pacific.net.au/~bangsund/muphry.htm> [sic]

With apologies to the OP, I look forward to learning what was leaking
from his applet.
 
P

phil89

Hi

My english is not very good that's true.
When i calling destroy() method from applet, Browser don't give me
memory.
I tried now to calling destroy method from HTML page when i leaving
html page

Philippe
 
P

phil89

It seems me Applet is not unloaded from Memory when destroy method is
calling from applet and when i leave html page to another without Java
applet ?

Regards
Philippe
 
J

John B. Matthews

[Votre anglais est bien meilleur que mon français, sûrement! Je me
réjouis de correction.]
It seems m[y] Applet is not unloaded from memory when [the] destroy
method is called from [my] applet and when leave [my HTML] page
[for] another without [a] Java applet?


If you have not already done so, implement the destroy method:

public void destroy() {
System.out.println("C'est tout, mes amis...");
}

Then, enable the Java console, so you can see what happens. Some
browsers do not invoke destroy correctly, so you should verify this.

Finally, examine your code for objects that may need special attention,
e.g. stopping a thread, disposing of a resource, nulling a reference,
etc.

Here's an appealing example:

<http://www.neuralsemantics.com/applets/gtracker.html>
 
A

Arne Vajhøj

John said:
It seems m[y] Applet is not unloaded from memory when [the] destroy
method is called from [my] applet and when leave [my HTML] page
[for] another without [a] Java applet?


If you have not already done so, implement the destroy method:

public void destroy() {
System.out.println("C'est tout, mes amis...");
}

Then, enable the Java console, so you can see what happens. Some
browsers do not invoke destroy correctly, so you should verify this.

Finally, examine your code for objects that may need special attention,
e.g. stopping a thread, disposing of a resource, nulling a reference,
etc.


That is good advice.

It could be a browser/plugin thing or it could be a code thing.

Troubleshooting is needed.

We can't say based on the presented information that the bug is in
line 42.

Arne
 
A

Arne Vajhøj

Lew said:
You're my hero! Seriously, you have a great attitude.


This and a matching Wikipedia article on "byte" were recent reading for
me, and I looked them up again as I wrote my post cited above. I, too,
had gotten so used to eight-bit bytes that I'd completely forgotten
about other widths until I read those articles a little while ago.

In Java a byte is (logically) 8 bit.

But other byte sizes do exist.

I remember CDC with 6 bit bytes.

Arne
 
W

Wojtek

Arne Vajhøj wrote :
In Java a byte is (logically) 8 bit.

But other byte sizes do exist.

I remember CDC with 6 bit bytes.

bit
nybble - 4 bits
byte - 8 bits
word - any number of bits as determined by the proccessor

Always.

So your CDC had a 6 bit word size.
 
T

Tom Anderson

Arne Vajhøj wrote :

bit
nybble - 4 bits
byte - 8 bits
word - any number of bits as determined by the proccessor

Always.

No.

Today, byte always means eight bits. Historically, byte was used to mean a
variety of numbers of bits, depending on the machine. Some machines even
had variable-sized bytes, right back at the dawn of time. 36-bit machines
with 6-bit bytes were particularly common, i believe.

tom
 
R

RedGrittyBrick

Wojtek said:
Arne Vajhøj wrote :

bit
nybble - 4 bits
byte - 8 bits
word - any number of bits as determined by the proccessor

IME word-size has always been a multiple of byte-size. Not an arbitrary
number of bits.
Always.

So your CDC had a 6 bit word size.

The CDC 6000 series had a word size of 60 bits.
http://en.wikipedia.org/wiki/CDC_6600#Wordlengths.2C_characters

"The central processor had 60-bit words, whilst the peripheral
processors had 12-bit words. CDC used the term "byte" to refer to 12-bit
entities used by peripheral processors; characters were 6-bit, ..."

I worked on computers with six-bit bytes in my early career.
 
J

John B. Matthews

[QUOTE="Wojtek said:
In Java a byte is (logically) 8 bit.

But other byte sizes do exist.

I remember CDC with 6 bit bytes.

bit
nybble - 4 bits
byte - 8 bits
word - any number of bits as determined by the proccessor

Always.

So your CDC had a 6 bit word size.[/QUOTE]

I think the CDCs had a 48- or 60-bit word size. Each word could hold up
to six or ten 6-bit characters, respectively.

<http://en.wikipedia.org/wiki/CDC_1604>
<http://en.wikipedia.org/wiki/CDC_6600>

I never used a CDC, but I recall the 6-bit ASCII table in Jensen &
Wirth's _Pascal_User_Manual_and_Report_, 2nd ed:

<http://www.inf.ethz.ch/personal/wirth/books/Pascal/>

I don't think a byte is _always_ eight bits, based on the article Lew
mentioned:

<http://en.wikipedia.org/wiki/Byte>
 
W

Wojtek

John B. Matthews wrote :
I don't think a byte is _always_ eight bits, based on the article Lew
mentioned:

<http://en.wikipedia.org/wiki/Byte>

Well, you learn something new every day...

* 2 bits: crumb, quad, quarter, tayste, tydbit
* 4 bits: nibble, nybble
* 5 bits: nickel, nyckle
* 10 bits: deckle
* 16 bits: plate, playte, chomp, chawmp (on a 32-bit machine)
* 18 bits: chomp, chawmp (on a 36-bit machine)
* 32 bits: dinner, dynner, gawble (on a 32-bit machine)
* 48 bits: gobble, gawble (under circumstances that remain obscure)
 
J

John B. Matthews

I don't think a byte is _always_ eight bits, based on the article Lew
mentioned:

<http://en.wikipedia.org/wiki/Byte>

Well, you learn something new every day...

* 2 bits: crumb, quad, quarter, tayste, tydbit
* 4 bits: nibble, nybble
* 5 bits: nickel, nyckle
* 10 bits: deckle
* 16 bits: plate, playte, chomp, chawmp (on a 32-bit machine)
* 18 bits: chomp, chawmp (on a 36-bit machine)
* 32 bits: dinner, dynner, gawble (on a 32-bit machine)
* 48 bits: gobble, gawble (under circumstances that remain obscure)[/QUOTE]

And, of course, "shtickle," a small amount or modicum, also used to
measure fluoride [Seinfeld, Episode 22: The Summer of George]. :)
 
L

Lew

John B. Matthews wrote :
Well, you learn something new every day...
* 2 bits: crumb, quad, quarter, tayste, tydbit
* 4 bits: nibble, nybble
* 5 bits: nickel, nyckle
* 10 bits: deckle
* 16 bits: plate, playte, chomp, chawmp (on a 32-bit machine)
* 18 bits: chomp, chawmp (on a 36-bit machine)
* 32 bits: dinner, dynner, gawble (on a 32-bit machine)
* 48 bits: gobble, gawble (under circumstances that remain obscure)

And, of course, "shtickle," a small amount or modicum, also used to
measure fluoride [Seinfeld, Episode 22: The Summer of George]. :)

It's all kibi-bulls### and bits.
 
M

Martien Verbruggen

Not correct. Historically, "byte" referred to many different sizes,
depending on machine architecture. So, not "always".

Not just historically. Also depending on context. For example, in C a
byte has CHAR_BIT bits, and CHAR_BIT is not necessarily 8.

There's a good reason Internet RFCs refer to octets when they mean 8
bits. If a byte were always 8 bits, they wouldn't need to do that.

Martien
 
A

Arne Vajhøj

Wojtek said:
Arne Vajhøj wrote :

bit
nybble - 4 bits
byte - 8 bits
word - any number of bits as determined by the proccessor

Always.

Not true.

8 bits per byte is just standard today.
So your CDC had a 6 bit word size.

No.

60 bit word with 10 bytes of 6 bit each.

Arne
 
A

Arne Vajhøj

John said:
[QUOTE="Wojtek said:
Lew wrote:
Lew wrote:
I think most of us know what "ko" (kilo-octets) means, and that it's
actually more precise than "kbytes", since a byte need not necessarily
be
eight bits but an octet must be. Thanks for the elucidation anyway,
though.
John B. Matthews wrote:
Aha! Thanks. I overlooked the correct interpretation, but I always enjoy
learning something new:
You're my hero! Seriously, you have a great attitude.

<http://en.wikipedia.org/wiki/Octet_(computing)>
This and a matching Wikipedia article on "byte" were recent
reading for me, and I looked them up again as I wrote my post
cited above. I, too, had gotten so used to eight-bit bytes that
I'd completely forgotten about other widths until I read those
articles a little while ago.
In Java a byte is (logically) 8 bit.

But other byte sizes do exist.

I remember CDC with 6 bit bytes.
bit
nybble - 4 bits
byte - 8 bits
word - any number of bits as determined by the proccessor

Always.

So your CDC had a 6 bit word size.

I think the CDCs had a 48- or 60-bit word size. Each word could hold up
to six or ten 6-bit characters, respectively.

<http://en.wikipedia.org/wiki/CDC_1604>
<http://en.wikipedia.org/wiki/CDC_6600>[/QUOTE]

This one was not a 6600 but something compatible.

18 bit word addresses of 60 bit words of 10 bytes of 6 bit.
I never used a CDC, but I recall the 6-bit ASCII table in Jensen &
Wirth's _Pascal_User_Manual_and_Report_, 2nd ed:

Not ASCII. ASCII needs at least 7 bit.

I think it was called "Display". Only one case of
letters.

If one needed bot lower and upper case, then one needed to
use the ASCII 6/12 with a character being either 1 byte of 6 bit
or 2 bytes of 6 bit each. Actually rather similar to UTF-8
when thinking about it !

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,169
Latest member
ArturoOlne
Top