当前位置:网站首页>JVM method area
JVM method area
2022-06-11 21:05:00 【Just number six Z】
JVM Method area
Understanding of method area
《Java Virtual machine specification 》 It is clearly stated in :" Although all method areas are logically part of the heap , But some simple implementations may not choose to do garbage collection or compression .” But for the HotSpotJVM for , The method area also has an alias called Non-Heap ( Non heap ), The purpose is to separate it from the pile .
therefore , The method area is regarded as a block independent of Java Heap memory space .
We can check the existence of the method area by testing the code .
/** * @author zal * @date 2022 year 02 month 19 Japan 20:49 * @Description The default value of the test setting method area size parameter , Set up JVM Parameter is -Xms600m -Xmx600m */
public class MethodAreaDemo {
public static void main(String[] args) {
System.out.println("start..");
try{
Thread.sleep(100000);
}catch (InterruptedException e){
e.printStackTrace();
}
System.out.println("end...");
}
}
After running the program, you can use javaVisualVM Look at the memory distribution .

So we can say that the method area is an independent space of the heap .
- Method area (Method Area) And Java Pile up , Is an area of memory Shared by each thread .
- Methods in JVM Created at startup , And its actual physical memory space neutralizes Java The heap area can also be discontinuous .
- The size of the method area , Like heap space , You can choose to be fixed size or scalable .
- The size of the method area determines how many classes the system can hold , If the system defines too many classes , Cause method area overflow , Virtual machines also throw out memory overflow errors : java.lang.outOfMemoryError:PermGen space perhaps java.lang.outOfMemoryError: Metaspace
- close JVM This will free the memory in this area .
Set method area size
jdk7 before , The permanent generation size can be used
-XX:Permsizeand-XX:MaxPermsizejdk8 in the future , The size of meta space can be
-XX:MetaspaceSizeand-XXMaxMatespaceSizeAppoint
The internal structure of the method area
1) Type information
- The full class name of the type
- The full valid name of the immediate parent of the type
- Type modifier
- A sequence table of type direct interfaces
2) Domain information
- JVM Information about all fields of the type and the order in which the fields are declared must be stored in the method area
- Relevant information includes : Domain name 、 Domain type 、 Domain modifier
3) Methods information
- Method name
- Return type of method
- Number and type of method parameters
- Method modifier
- Bytecode of method
- Anomaly table
4)non-final Class variables
- Static variables are associated with classes , Load as class loads
- Class variables are shared by all instances of a class , Even if there is no class instance , You can also visit
边栏推荐
- unity package manager starting server stuck(Unity啟動卡在starting server,然後報錯)
- Ubantu1804 two opencv versions coexist
- Why should I use iwarp, roce V2, nvme of and other protocols for 100g network transmission
- 使用 float 创建一个网页页眉、页脚、左边的内容和主要内容。
- Unity package manager starting server stuck
- Release of version 5.6 of rainbow, add multiple installation methods, and optimize the topology operation experience
- Work assessment of spectral analysis of Jilin University in March of the 22nd spring -00079
- Field queryIndexFieldnameService in xxxImpl required a single bean, but 19 were found:
- Application scenario: wide application of Poe network card in NDI technology for live broadcast program production
- Windows icon display exception resolution. The desktop icon is abnormal, the start menu icon is abnormal, and the taskbar icon is abnormal. Icon cache location.
猜你喜欢
![[data visualization] Apache superset 1.2.0 tutorial (II) - Quick Start (visualizing King hero data)](/img/21/c2212a674fdf77571305446217a5ca.png)
[data visualization] Apache superset 1.2.0 tutorial (II) - Quick Start (visualizing King hero data)

Frequency domain filter

go语言的goto语句

Live broadcast with practice | 30 minutes to build WordPress website with Alibaba cloud container service and container network file system

gateway先启动其他微服务,在启动网关,网关启动不了,且无异常日志;先启动网关,所有服务能正常启动

unity package manager starting server stuck(Unity啟動卡在starting server,然後報錯)

Why should I use iwarp, roce V2, nvme of and other protocols for 100g network transmission

Three waves of changes in cloud computing

File upload vulnerability - simple exploitation 2 (Mozhe college shooting range)

Online excel file parsing and conversion to JSON format
随机推荐
Application scenario: wide application of Poe network card in NDI technology for live broadcast program production
从概率论基础出发推导卡尔曼滤波
全球机器视觉市场规模持续上涨,PoE图像采集卡为工业相机提供高速传输通道
New product release: lr-link Lianrui launched the first 25g OCP 3.0 network card
技术交流|网络安全设备为什么要用Bypass功能
电竞网咖用2.5G网卡,体验飞一般的感觉!
Object storage of CEPH distributed storage
Field queryIndexFieldnameService in xxxImpl required a single bean, but 19 were found:
IDEA中,运行yarn命令,显示无法加载文件,因为在此系统上禁用运行脚本
Mysql add 新增多个新字段并指定字段位置
[unity plug-in] shader keyword analysis tool shadercontrol
On scale of canvas recttransform in ugui
LR-LINK联瑞携新品首次亮相数博会-助力新基建数据中心建设
Unity screenshot
Obsidian关系图谱如何让节点可以手动拖动
[index system] the latest modeling method of data warehouse index system
Serval and rooted Tree (cf1153d) - DP
[Monday commuter radio station] cron expression. It's enough to read this article
Log in with password and exit with error for three times.
应用场景:现场直播节目制作NDI技术中PoE网卡的广泛应用