title: How to force Garbage Collection related Heap Dump in Websphere?
body: <p>I am having a problem with my Java EE application where I am seeing a heap dump now and then in production environment which uses WebSphere application server. This dump is occurring at some random time in a class where it uses the PDF generation library that uses a DLL file to generate some reports. This is also causing the JVM to restart automatically.</p>
  
  <p>Looking at the dump files and native_stderr.log, it seems that there was problem with Garbage collection at the same time. There are errors like:</p>
  
  <pre><code>reason="insufficient time being spent in gc" gctimepercent="1" 
  </code></pre>
  
  <p>Also, the segmentation fault error looks like:</p>
  
  <pre><code> Unhandled exception Type=Segmentation error vmState=0x00000000
  J9Generic_Signal_Number=00000004 ExceptionCode=c0000005 ExceptionAddress=7F030F32 ContextFlags=0001003f
  Handler1=7F040D90 Handler2=7F0E7D70 InaccessibleAddress=35A13000
  EDI=0CD776C8 ESI=35A13000 EAX=0004AEF8 EBX=24DB5500
  ECX=00009FC6 EDX=0004AEF8
  EIP=7F030F32 ESP=2C14FD5C EBP=2C14FDC4
  Module=E:\u01\was61\java\jre\bin\j9vm23.dll
  Module_base_address=7F020000 Offset_in_DLL=00010f32
  Target=2_30_20090224_30451_lHdSMr (Windows Server 2003 5.2 build 3790 Service Pack 2)
  CPU=x86 (4 logical CPUs) (0x1fff37000 RAM)
  JVMDUMP006I Processing Dump Event "gpf", detail "" - Please Wait.
  JVMDUMP007I JVM Requesting System Dump using 'E:\data\servers\MyApp\workdir\core.20120103.101629.9812.0001.dmp'
  JVMDUMP010I System Dump written to E:\data\servers\MyApp\workdir\core.20120103.101629.9812.0001.dmp
  JVMDUMP007I JVM Requesting Snap Dump using 'E:\data\servers\MyApp\workdir\Snap.20120103.101629.9812.0002.trc'
  JVMDUMP010I Snap Dump written to E:\data\servers\MyApp\workdir\Snap.20120103.101629.9812.0002.trc
  JVMDUMP007I JVM Requesting Java Dump using 'E:\data\servers\MyApp\workdir\javacore.20120103.101629.9812.0003.txt'
  JVMDUMP010I Java Dump written to E:\data\servers\MyApp\workdir\javacore.20120103.101629.9812.0003.txt
  JVMDUMP013I Processed Dump Event "gpf", detail "".
  </code></pre>
  
  <p>The heap dump says that the cause of the dump was "gpf" and talks about Segmentation Fault.</p>
  
  <p>I am trying to reproduce the same in my local environment without any success. What I am trying to do is force some kind of frequent Garbage collection by setting some parameters while I try to generate the report. What are the weird parameters that I can set in the Websphere Admin Console so that it does GC more often?</p>