简体   繁体   中英

Out of Memory - web applications

I am trying to figure out why Jetty 6.1.22 is running out of memory on my laptop. I have 2 web applications running JBoss Seam, Hibernate (with EHCache), and separate Quartz scheduler instances.

With little load, the server dies throwing OutOfMemory.

What can I look for? Would you think that I am not properly closing handles for input streams or files?

I tried profiling my application with Netbeans, but it works off and on. Usually, it ends up locking up even though it doesn't use that much CPU or memory.

Walter

What are you JVM's execution parameters?

Try increasing available heap memory though -Xms (default) -Xmx (max) and -Xmn (min) JVM's flags.

You can also monitor your Application Server execution with JConsole . It's usually helpful for finding out where is you application leaking.

add -XX:+HeapDumpOnOutOfMemoryError when invoking the jvm and when you get the OOM situation you will get a .hprof file dumped. You can open it later with several tools and you'll be able to see where the memory is going...

The tool I use is Eclipse Memory Analyzer , it's pretty good.

I can strongly recommend attaching to the troublesome program with jvisualvm in the JDK.

This allows you to investigate memory and cpu usage over time and inspect what happens in general.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM