java - How to find which Class is causing OutOfMemory for the JVM? -
oflate our weblogic server crashing outofmemory error. there way can monitor jvm find out classes are hogging memory , have maximum number of objects?
yes. way did configure jvm create heap dump on oom, pulled heap down , ran thru jvisualvm. can compute retained sizes (took long time) clear offender is.
you can attach jvisualvm running instance, need configure jvm accept connection. way can watch heap grow in real time. see this; jboss should similar: https://wiki.projectbamboo.org/display/btech/visualvm+profiler
i think easier answer after have heap dump though, when watch in real time things garbage collected , whatnot.
edit -- here startup configs.
-xx:+printgcdetails -xx:+printgctimestamps -xloggc:/path/to/memlogs/memlog.txt -xx:+printtenuringdistribution -xms1024m -xmx2048m -xx:maxpermsize=128m -server -dcom.sun.management.jmxremote -dcom.sun.management.jmxremote.port=xxxx -dcom.sun.management.jmxremote.ssl=false -dcom.sun.management.jmxremote.authenticate=false -djava.rmi.server.hostname=<ip-address> -xx:+heapdumponoutofmemoryerror -xx:heapdumppath=/path/to/heapdumps/ -xx:+cmsclassunloadingenabled -xx:+cmspermgensweepingenabled -xx:+useconcmarksweepgc
because configured drop memory logs, can tail memlog.txt file in real time see happened. can connect jvm if want, said analyze heap after crash see issue is, because after fact clear....
Comments
Post a Comment