spring - Tomcat - PermGen space Exception -


iam using tomcat 6, springs, hibernate , struts in application. exception in logs regarding memory , site hangs , stops responding. iam not sure whats wrong. can suggest changes has done avoid this.

org.apache.tomcat.util.threads.threadpool$controlrunnable run severe: caught exception (java.lang.outofmemoryerror: permgen space) executing org.apache.jk.common.channelsocket$socketconnection@2c52d3, terminating thread

the permgen space tomcat uses store class definitions (definitions only, no instantiations) , string pools have been interned. experience, permgen space issues tend happen in dev environments since tomcat has load new classes every time deploys war or jspc (when edit jsp file). personally, tend deploy , redeploy wars lot when i’m in dev testing know i’m bound run out sooner or later (primarily because java’s gc cycles still kinda crap if redeploy wars , enough, space fills faster can manage).

this should theoretically less of issue in production environments since (hopefully) don’t change codebase on 10 minute basis. if still occurs, means codebase (and corresponding library dependencies) large default memory allocation , you’ll need mess around stack , heap allocation. think standards stuff like:

-xx:maxpermsize=size i’ve found best way take care of allow classes unloaded permgen never runs out:

-xx:+cmsclassunloadingenabled -xx:+cmspermgensweepingenabled stuff worked magic me in past. 1 thing tho, there’s significant performance tradeoff in using those, since permgen sweeps make 2 requests every request make or along lines. you’ll need balance use tradeoffs.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -