JOL is hanging when running from module path

Zheka Kozlov orionllmain at gmail.com
Tue Oct 24 04:35:20 UTC 2017


I have the following program:

package org.example;

import org.openjdk.jol.vm.VM;

public class Example {

    public static void main(String[] __) throws Throwable {
        System.out.println(VM.current().details());
    }
}

and module-info:

module java9 {
    requires jol.core;
    requires jdk.attach;
}

Then I run the program with the following args:

java -p
java9.jar;C:\Users\john_kozlov\.m2\repository\org\openjdk\jol\jol-core\0.9\jol-core-0.9.jar
-m java9/org.example.Example

The program is hanging with no output.

The cause of the problem is an empty
classpath: ServiceabilityAgentSupport.java:279. Since the classpath is
empty, the process is hanging infinitely
(ServiceabilityAgentSupport.java:242).

I think we should either skip the invocation of
ServiceabilityAgentSupport.senseAccess or fix it to handle the module path
properly.


More information about the jol-dev mailing list