Title: RE: memory leak... some one help, please!!
well, I tested my class out on JDK 1.3.0.02 and the memory leak isn't really there...
it creeps a little, but should be fine now. 
JDK 1.2, about 300KB of memory added per second.
JDK 1.3.0.02 it goes up to about 12-13MB and stays there.
aaron
-----Original Message-----
From: Pepelis, Aaron [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 06, 2001 1:55 PM
To: [EMAIL PROTECTED]
Subject: RE: memory leak... some one help, please!!

um.. I don't think I expressed my self right.
It must be the new england accent.

ahem, I'm using this Output window to show the user the passed size_of_buffer characters that my tool has written to the screen.  I don't care about the ones before that.  They should "scroll off" the screen or in this case, be removed form the output area, disappearing and having the memory be reclaimed. 

the best example I can give of what I want is the command prompt in nt 4.0/2K when you tell it how big the buffer is and is only saves that many line.  and it's FIFO, new lines push out the oldest lines.

make more sense?
aaron

-----Original Message-----
From: Song, Mingjian [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 06, 2001 1:43 PM
To: 'Pepelis, Aaron'; [EMAIL PROTECTED]
Subject: RE: memory leak... some one help, please!!



If the 750 characters added each time are random characters, and
at the end of the loop, you want to keep record of all the 75
billion chars ever appended, then you can not avoid the excessive
memory usage. This is not a normal program, so do not surprise if
it has abnormal demanding on system resources.

If that is the case, I do not know if you have to design your
program this way. There must be better way out.

If every iteration, the same (or a limited possibility of) strings
are added, you may try to declare these possiblities as static Strings
to avoid the massive overhead of object creation. Also, I would
second the suggestions from John Zukowski about using StringBuffer
and limit the scope of tempString.

man, 400 million is lots of zero.

Mingjian Song


> -----Original Message-----
> From: Pepelis, Aaron [SMTP:[EMAIL PROTECTED]]
> Sent: Friday, April 06, 2001 1:27 PM
> To:   [EMAIL PROTECTED]
> Subject:      RE: memory leak... some one help, please!!
>
> I'm running on win2K with 256MB RAM.
> JDK 1.2.2

> Well, in that main method, it's only loops 400 times, but I have another
> tool that writes to that BufferedOutputArea about... um.. 100 million
> times
> or so, appending about 750 characters per iteration.  What that class is
> suppose to do is cull a certain number of characters after a certain
> number
> of characters making is a buffered out put... any ideas?
> aaron

Reply via email to