java - 请问类的静态成员对象存放在方法区?还是堆?
迷茫
迷茫 2017-04-18 10:35:09
0
2
453
迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(2)
迷茫

According to the JVM specification, JVM memory is divided into five parts: Virtual machine stack, Heap, Method area, Program counter, Local method stack.

Before Java7, the static variables of the class (referred to as class variables, such as the staff you wrote) were stored in the permanent generation (PermGen) - on the Hotspot JVM, PermGen is the method area; after Java7, the storage of class variables was transferred to the heap .

For more details about the JVM memory model, please refer to Zhou Zhiming's "In-depth Understanding of Java Virtual Machines Second Edition"

伊谢尔伦

Objects created using new are all in the heap.

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!