When I said that "surely it can't be a memory leak in my app" I was operating under 
the assumption that the JRE runs garbage collection periodically anyway....is this not 
true?
 
If I was waisting resources and not releasing them in a way that the GC could take 
them back when it runs automatically then why would it take them back when I call 
garbage collection explicitly?  To me, this suggested more of a systemic issue.  It 
was suggested by someone last night that I may want to look at some config lines to 
make sure GC is active and this seemed in line with my assumption.  Is there something 
else here that I may be missing however?  Can you see a possible explanation as to why 
my app's waisted resources would not get cleaned up until I explicitly ran GC?
 
Thanks.
Neal


"Shapira, Yoav" <[EMAIL PROTECTED]> wrote:

Howdy,
Perhaps you are experiencing higher load, which requires more memory.
Or perhaps your application does have a memory leak: those are possible
and occur in java, so yes that would a programming error on your part.
The garbage collector does much magic, but it can't save you all the
time. You may wish to read up on java memory leaks, as they've been
discussed at length on this list and on the net in general.

Note that when you call Runtime#gc that's only a suggestion to the JVM:
many times when you call that the garbage collector may not run at all.

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: Neal [mailto:[EMAIL PROTECTED]
>Sent: Sunday, November 30, 2003 8:21 PM
>To: 'Tomcat Users List'
>Subject: Garbage Collection issues
>
>My Tomcat 4.1 (hosted on Linux) seems to have a problem in recent
months
>with crashing due to unavailable free RAM. Specifically I get a
>java.error.outOfMemory exception. If check the RAM available
>(Runtime.getRuntime().totalMemory()), I can see it ticking down through
>the week. If explicitly run garbage collection however my RAM totally
>frees up and all is well (Runtime.getRuntime().gc();).
>
>Why would this happen? Surely this isn't due to a programming error on
>my part, otherwise, the resources should automatically released
whenever
>the JRE performs periodic garbage collection. Isn't that correct?
>Anyone have any theories as to what this may mean and what the best
>solution would be?
>
>Thanks.
>Neal
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged. This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else. If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender. Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------
Do you Yahoo!?
Free Pop-Up Blocker - Get it now

Reply via email to