Running jmap to dump the java heap for the OneClickService.exe
search cancel

Running jmap to dump the java heap for the OneClickService.exe

book

Article ID: 49734

calendar_today

Updated On:

Products

CA Spectrum

Issue/Introduction

Running jmap to dump the java heap for the OneClickService.exe

Jmap is a java tool used for memory profiling. It is used to take a heap snapshot (dump the heap without affecting the running process).


However, when running jmap against the OneClickService.exe process on Windows the following error is returned:

   > jmap -dump:format=b,file=heap.hprof 4820       
   4820: Not enough storage is available to process this command  

Environment

Release: Any version of Spectrum OneClick running on Windows
Component: SPCOCK

Cause

This error happens because jmap cannot run against a running service.

Resolution

To resolve this issue, stop the Spectrum tomcat service, open a bash shell and navigate to the $SPECROOT/tomcat/bin directory and
launch OneClickService.exe as follows:

       > OneClickService.exe --start --debug   
   Debugging "SpectrumTomcat"  

Let tomcat initialize and once the issue reproduces you can now run jmap against the OneClickService.exe process since it is now running in debug mode. The output will be similar to this:

       > jmap -dump:format=b,file=heap.hprof < PID of OneClickService.exe>       
       Dumping heap to C:\win32app\Spectrum\Java\bin\heap.hprof ... 
   Heap dump file created  

The jmap tool should be used at the recommendation of CA Spectrum support. Resulting heap.hprof files can be sent to CA Spectrum support for analysis.