Thoughts about java, ruby, agile and other every developer stuff.

Friday, July 27, 2007

OutOfMemory

There some memory problems. IMHO there are two options which can help You. On of them is:

-XX:+HeapDumpOnOutOfMemoryError

This option dumps heap state when out of memory occurs.

The second option is -XX:+HeapDumpOnCtrlBreak
This option activate on Ctrl+Break.
Also many tools provide dump on demand.

At production level heap has about 100000000 live object. So You must have time to look through dump file. It's no easy part, but it's worth.

In dump file You can find information about class, fields, primitive values and references the most important thing is information about objects defined to be reachable by the JVM software. A heap dump contains a snapshot of objects
that are alive at dump time And You must know that full GC is triggered before the heap dump is written.

When searching problems You should focuse on :
  • Inefficient data structures
  • Caches
  • Perm (class loaders leaks)
  • Model/Proxy-driven class generation

Regards
Pedro

0 Comments:

Post a Comment

<< Home