I reported a JVM bug to sun yesterday.  They mentioned that the problem has
been fixed.  Coincidently the work around is to increase the memory size that
is "used to store class objects and related metadata".  So I thought, hey, I
should try increasing and decreasing this and then reloading my context after
a tomcat4 restart.  Sure enough, I can make the tomcat4 run out of memory
really quickly with a 16M setting.  If I set it to 256M, it takes a very long
time to run out of memory.  In fact, I never seen it run out of memory.  I
reloaded it 91 times without a problem.  With a 16M setting I reloaded 6 times
and got an out of memory exception.


In my opinion, the class loader for tomcat should keep track of all the
classes it's loading.  When the context gets reloaded, it should then unload
all those classes.  I'm not exactly sure if this is even possible, because
unloading class variables might be class specific and there might not be a way
of actually unloading a class so that those class variable references get
discarded.  Maybe that's why someone suggested implementing the
ServletContextListener (in another thread)?  I don't know much about class
loaders! :)


So, the work around until someone implements a ServletContextListener and
unloads their own static variables (probably variable=null is sufficient?)
is...
-XX:MaxPermSize=128m -XX:PermSize=XXm

And an article that the Sun support guy gave me...
http://wireless.java.sun.com/midp/articles/garbagecollection2/


Specifically related to -XX flags...
http://wireless.java.sun.com/midp/articles/garbagecollection2/#a.5


> -----Original Message-----
> From: Shapira, Yoav [mailto:[EMAIL PROTECTED] 
> Sent: December 2, 2003 11:45 AM
> To: Tomcat Users List
> Subject: RE: Tomcat 4.0.x memory leak (not javac)
> 
> 
> Howdy,
> Since you can reproduce your error easily, can you narrow 
> down which 3rd
> party library is keeping the references that cause the memory leak?
> 
> Yoav Shapira
> Millennium ChemInformatics
> 
> 
> >-----Original Message-----
> >From: Trenton D. Adams [mailto:[EMAIL PROTECTED]
> >Sent: Tuesday, December 02, 2003 1:43 PM
> >To: 'Tomcat Users List'
> >Subject: RE: Tomcat 4.0.x memory leak (not javac)
> >
> >> -----Original Message-----
> >> From: David Rees [mailto:[EMAIL PROTECTED]
> >> Sent: December 2, 2003 11:01 AM
> >> To: Tomcat Users List
> >> Subject: Re: Tomcat 4.0.x memory leak (not javac)
> >>
> >> Shapira, Yoav wrote:
> >> > Besides what Senor Schultz said (which is 100% true),
> >> > 1. Where is this mentioned in the release notes, and what
> >> would one have
> >> > to search for?
> >>
> >> Under KNOWN ISSUES IN THIS RELEASE it does mention issues 
> during web
> >> application reloading where shared libraries keep references
> >> to objects
> >> instantiated by the web application.  That says "memory leak" to me
> >> although it doesn't specifically say that.
> >>
> >> > 2. You mentioned in your passage the bug was marked as invalid or
> >> > wontfix, and the bug you gave below is marked as new.  
> So if anyone
> >> > actually wasted time (like me) looking up what you said, they
> didn't
> >> > find it.
> >>
> >> All I did was search for "memory leak" under Tomcat 4 and all
> >> status.  I
> >> was not positive that it was marked WONTFIX, I should have 
> clarified
> >> that in my original message.  I had thought that the issue
> >> was something
> >> inherent to the design of Tomcat 4 (which was overhauled in
> >> Tomcat 5),
> >> but I'm sure that they are willing to accept patches if
> >> anyone can fix
> >> it.  ;-)
> >
> >Bugzilla is obviously not working sometimes.  I searched for "memory
> leak"
> >one
> >time and got it.  Then I went to search for it for someone else so I
> could
> >give them the bug number but nothing came up.  I did the exact same
> search,
> >"memory leak".  Very interesting indeed.  Heck, I even searched for
> just
> >"memory" or "leak" once each and came up with nothing.
> >
> >>
> >> -Dave
> >>
> >> 
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: 
> [EMAIL PROTECTED]
> >>
> >
> >
> >__
> >    This communication is intended for the use of the 
> recipient to whom
> it
> >    is addressed, and may contain confidential, personal, and or
> privileged
> >    information. Please contact us immediately if you are not the
> intended
> >    recipient of this communication, and do not copy, distribute, or
> take
> >    action relying on it. Any communications received in error, or
> >    subsequent reply, should be deleted or destroyed.
> >---
> >
> >---------------------------------------------------------------------
> >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]
> 


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

Reply via email to