I'm pretty sure you have a memory leak in your program. For year I've been thinking the JVM never returns memory and only increases it when needed, but after many weeks of experimentation, reading and analysis now I know the JVM reduces the java heap, when it doesn't I would look for memory leaks in my programs, specialy when you reload your context many times (perm gen space can fill up). There are lots of articles about memory leaks including tech docs in Sun about how the JVM recolects memory. Some of the issues I found in my app are: - You need to de-register your JDBC drivers if they are on you /lib directory. - Release jog4j, it holds references to your classes. - Don't use ThreadLocal's. - Make sure your threads are finished in a context reload.
This links can be useful http://opensource.atlassian.com/confluence/spring/pages/viewpage.action?pageId=2669 http://www.szegedi.org/articles/memleak.html (great article!) http://www.javaperformancetuning.com/tools/hpjmeter/index.shtml http://www.javaperformancetuning.com/tools/hpjmeter/index.shtml http://java.sun.com/docs/hotspot/gc1.4.2/faq.html http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html -----Original Message----- From: Peter Crowther [mailto:[EMAIL PROTECTED] Sent: Martes, 29 de Agosto de 2006 11:29 a.m. To: Tomcat Users List Subject: RE: Handling huge amount data > From: Robert Harper [mailto:[EMAIL PROTECTED] > I've seen the memory rise and fall so if the GC releases=20 > memory, it should be returned to the OS. ... at some point, assuming the GC is capable of compacting the heap to give an entirely free block of memory that can be returned to the OS, and assuming that (in Windows) the OS is under memory pressure and is requesting processes to free what memory they can. I have to say I've never observed a JVM returning memory to the OS, even under quite severe OS memory pressure. Equally I may not have been looking when it did! - Peter ------------------------------------------------------------------------------ Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu - direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. ------------------------------------------------------------------------------ --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]