jvisualvm install gc plugin

Enter
"Tools"-"Plugins" of the plugin management of jvisualvm

Online installation

Modify the URL address in "Settings" to the address that corresponds to our JDK version we found on github just now

After the modification is successful, the available plug-ins can be refreshed

Offline installation

Install the downloaded plugin

Download link: find the corresponding jdk version and install the corresponding version of gc

https://visualvm.github.io/pluginscenters.html

Install the VisualGC plugin

You can see VisualGC

practice:

public class OOMTest {

    byte[] b = new byte[1024 * 10];

    public static void main(String[] args) throws InterruptedException {
        ArrayList<OOMTest> all = new ArrayList<>();
        while (true) {
            all.add(new OOMTest());
            Thread.sleep(10);
        }
    }
}

You can see that gc is happening all the time 

Guess you like

Origin blog.csdn.net/nmjhehe/article/details/113836259