OutOfMemory

Posted in java by pedro | Friday, July 27th, 2007 at 1:57 pm

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

Leave a Reply

about me

My name is Sebastian Pietrowski. I've finished Warsaw University as Master degree. I started my journey with Java 1.1 with Thread and JDBC programing in 1998 as I worked for merlin.pl. In 1999 I've passed Java Programer Certificate for Java 1.2, and was solution architect of merlin.pl infrastructure when we was moving from pl/sql to J2EE. It was great performance optimization with 10 times more req/sec than in requirements and 85 times faster as original solution.

Currently I work as Expert Software Development Java at F.Hoffmann-La Roche. The company was founded in 1896 and today, Roche employs over 80.000 people. After work I'm involved in activities related to Scala/Lift, Ruby/Rails/Merb, Python/Django. This is because I try to be pragmatic also I'm focused on application performance and tuning with success in my daily work.

My Yoda's motto: Do, or do not. There is no try.