简体   繁体   中英

Simple Java program - profiling shows unexpected behavior

Given an extremely simple java program, shown below, I start the program and profile with VisualVM.

public class test {

   public static void main(String args[]) throws InterruptedException{
      Thread.sleep(10000000L);
   }

}

As can be seen by the below metrics, something behind the scenes just keeps on ticking. What could possibly be going on behind the scenes here? I also included a screenshot of the "Sampler" memory and it looks as if a bunch of primitive arrays just keep getting created, why is this?

在此输入图像描述

在此输入图像描述

You are connected to the process with VisualVM. Obviously, it takes some work to present you with the fact that the JVM is doing some work :) In specific detail, data is being collected and sent over the JMX connection. Some garbage is created.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM