Real-Time memory profiling of JVM

Version 2
    Share This:

    Visual VM is a third party tool that allows us to profile any JVM in real time. Usually used when you are repeatedly notice Out of Memory errors on tuner..

    Following are the steps (specifically for Marimba) that you need to implement on machines that are frequently hitting into Out of Memory issues:


       1. Copy the attached JDK rar file and extract it on the affected machine.


       2. Change java args on the tuner that we are going to debug (specifically, add below arguments to the "marimba.launch.javaArgs" property):



    Note: Like all tuner "java arguments", if you are directly writing into prefs.txt (or properties.txt) using a text editor, then the "=" portions need to be "escaped" out, e.g.:



    If these are being added using Tuner Administration through the UI, then you don't need to "escape" the "=" portions of the command line.



       3. Restart the tuner once in order to "apply" the VisualVM-related arguments.


       4. Start VisualVM with argument:

       visualvm --jdkhome <Path of JDK Folder e.g.  jvisualvm --jdkhome c:\java\jdk1.6.0>


    The VisualVM UI should appear on screen. If it doesn't, check that the command line points to the "correct" location of installed JDK on the machine.


       5. Once VisualVM is started, connect it to the running tuner as per the information in:

    Specifically, the steps in section "Local JMX Connections", Steps 3 and 4 are required from above link (only, instead of port 3333, set it to port 2245 since that's what has been configured in the tuner start up arguments)


    Note: If you see problems with connecting to the tuner, then you would probably need to recheck the "java arguments" that were configured on the tuner in step 3 (the link in this step gives you the exact arguments for comparison).


       6. Once it’s connected, your tuner will be monitored by VisualVM. One final step here is to set the monitoring "interval" to encompass one full day. In order to do this, in the VisualVM GUI, in the menu bar, click Tools, and select Options.


    In the Options dialog, in the General Tab, change the values next to "Monitored Host" and "Monitored Data" labels to 24*60 = 1440 minutes (i.e. 24 hours) and click OK.


    After 24 hours elapses, you can collect the heap dump and thread dump from the VisualVM tool in order to investigate any suspicious thread activities or OOM errors.