java - PrintGCDetails问题
高洛峰
高洛峰 2017-04-17 13:15:05
0
1
323
高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(1)
伊谢尔伦

At least the Main class is loaded, and the AppClassLoader responsible for loading main is also instantiated. So there must still be some objects generated along with main. The difference between Java and native languages ​​​​such as C++/C is that it is difficult to ensure that what you see is what you get....
I added some code to prove that some objects were generated before main...

import java.util.Objects;

public class MyTest{

    static{
        System.out.println(MyTest.class.getClassLoader().getClass().getName());
    }
    public static void main(String[] args) {

    }
}

Since I am not very familiar with the JVM memory pool model, I cannot say whether some memory pool objects will be generated during this process.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!