简体   繁体   English

简单的Java程序 - 分析显示意外的行为

[英]Simple Java program - profiling shows unexpected behavior

Given an extremely simple java program, shown below, I start the program and profile with VisualVM. 给定一个非常简单的java程序,如下所示,我用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? 我还包括了“Sampler”内存的屏幕截图,看起来好像一堆原始数组一直在创建,为什么会这样?

在此输入图像描述

在此输入图像描述

You are connected to the process with VisualVM. 您已使用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. 显然,需要一些工作来向您展示JVM正在做一些工作:)具体细节,数据正在收集并通过JMX连接发送。 Some garbage is created. 创建了一些垃圾。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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