Saturday, February 04, 2012

Visual GC Error: Not Supported for this JVM

The Visual GC plugin for Visual VM graphically displays garbage collection, class loader, and HotSpot compiler performance data.

If you install this plugin and, like me, get the error "Not Supported for this JVM", when you try to start Visual GC, try the following steps:

  1. Start jstatd on the remote host. You need to specify a policy file, otherwise you will get an AccessControlException: access denied exception. Create a policy file e.g. /tmp/tools.policy containing:
    grant codebase "file:${java.home}/../lib/tools.jar" {
       permission java.security.AllPermission;
    };
    
    Then start jstatd using the command below:
    jstatd -J-Djava.security.policy=/tmp/tools.policy
    
  2. Start Visual VM. Add a Remote Host and then add a "jstatd connection" to it. Your JVM should appear in the list. You can then click on it and look at the "Visual GC" tab for garbage collection information.

5 comments:

  1. Thanks.....It helped me :)

    ReplyDelete
  2. very helpful, your blog happened to help me twice since 4 months ! I will definitly bookmark it now. Thank you, Fahd

    ReplyDelete
  3. Thank you. This worked like a charm.

    ReplyDelete
  4. I followed your steps but it still say "Not Supported for this JVM",My local machine is Windows 10 64bit with jdk1.8 64bit, my remote machine is Ubuntu14.04 with jdk1.8 64bit.The 1099 port is open .Could you please tell me how to fix it? I am very grateful

    ReplyDelete