Friday, 15 February 2013

java - why webappclassloader is not garbage collected ? -



java - why webappclassloader is not garbage collected ? -

i have web service developped spring/hibernate, , when deployment , undeployment on tomcat 7 many times, outofmemoryerror permgen memory leak.

by using java visualvm, noticed previous webappclassloader still kept in jvm, not garbage collected.

what can reasons of problem ?

how can observe objects still have reference application class loader or object loaded ?

thanks,

the short reply have memory leak. experience, in web application or library using. possible, unlikely, have found memory leak in tomcat.

the short version tracking downwards memory leak is:

start tomcat undeploy , redeploy problematic application once use profiler examine heap look instances of webappclassloader find 1 held has attribute of started = false trace gc roots instance of webappclassloader that point memory leak

finding root cause of memory leak might little harder.

for fuller explanation of how track downwards sort of memory leak , might cause them see presentation: http://people.apache.org/~markt/presentations/2010-08-05-memory-leaks-javaone-60mins.pdf

java hibernate tomcat memory-leaks garbage-collection

No comments:

Post a Comment