tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: RE : Does Tomcat trim sessions when it runs out of memory?
Date Fri, 22 Aug 2003 16:31:08 GMT

Howdy,
Yes, there is indication somewhere about the memory currently used by tomcat: Runtime.getRuntime().totalMemory()
- Runtime.getRuntime().freeMemory().

As you can tell from the functions, they're JVM-wide, not Tomcat-specific.  This would be
true for any program, as all classes in the JVM share one heap.

Tomcat's objects are cleaned up normally by the garbage collector, just like all other program
objects.  Tomcat's programmers take care not to keep unneeded references to objects which
would prevent collection, but we like everyone else are not perfect.  So if you see a memory
leak in the code, by all means point it out.

Most of the time, applications leak memory, and do so in amounts much larger than tomcat itself.
 Profile your application to see where memory is used so that you can correct the code.  At
the same time, you can profile tomcat by itself if you're not convinced its memory use is
efficient.

Sometimes, applications need more than the default 64MB java allocates the heap.  In that
case, you would increase the heap size as needed by your app.

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: Hertenstein Alain [mailto:alhertenstein@gva.eri.ch]
>Sent: Friday, August 22, 2003 10:50 AM
>To: 'Tomcat Users List'
>Subject: RE : Does Tomcat trim sessions when it runs out of memory?
>
>Is there any indication somewhere about the memory currently used by Tomcat
>and the maximum memory allowed ?
>Is there a way to "clean up" memory used by Tomcat in order to avoid
>OutOfMemoryErrors (like a Garbage Collector for Java or something) ?
>
>Thanks
>
>-----Message d'origine-----
>De : Shapira, Yoav [mailto:Yoav.Shapira@mpi.com]
>Envoyé : vendredi, 22. août 2003 15:20
>À : Tomcat Users List
>Objet : RE: Does Tomcat trim sessions when it runs out of memory?
>
>
>
>Howdy,
>No, it doesn't get rid of sessions (it's not allowed to according to the
>spec).  In fact, tomcat doesn't try to detect when it's "running out of
>memory" and doesn't do anything about it: if you don't have enough memory,
>tomcat will go into an undefined state (or just die) with an
>OutOfMemoryError.
>
>
>Yoav Shapira
>Millennium ChemInformatics
>
>
>>-----Original Message-----
>>From: Neil Aggarwal [mailto:neil@JAMMConsulting.com]
>>Sent: Thursday, August 21, 2003 10:03 PM
>>To: 'Tomcat-User'
>>Subject: Does Tomcat trim sessions when it runs out of memory?
>>
>>Hello:
>>
>>I have a question:
>>
>>Does Tomcat get rid of sessions when it run out of memory?
>>
>>We are seeing sessions disappear on our app and are trying
>>to find an explanation for it?
>>
>>What does Tomcat do when it begins to run out of memory?
>>
>>Thanks,
>>	Neil
>>
>>--
>>Neil Aggarwal, JAMM Consulting, (972)612-6056, www.JAMMConsulting.com
>>FREE! Valuable info on how your business can reduce operating costs by
>>17% or more in 6 months or less! =>
>http://newsletter.JAMMConsulting.com
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>
>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: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>**********************************************************************
> This email and any files transmitted with it are confidential and
>intended solely for the use of the individual or entity to whom they
>are addressed. If you have received this email in error please notify
>the system manager.
>**********************************************************************
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org




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.


Mime
View raw message