我对JVM的理解

JVM memory

A 下面两个是共享的:

<1> heap

Runtime.getRuntime().totalMemory();

Runtime.getRuntime().maxMemory();  Xmx : 年轻代+年老代
Runtime.getRuntime().freeMemory();

totalMemory-freeMemory=usedSize

Xms

Xmn: 年轻代 

<2> permenant : 逻辑上属于堆。物理上不属于,也称“非堆”


B 下面不共享

<3> Xss 栈大小,包括JVM栈和NATIVE栈. 可创建线程:进程内支持线程限定。操作系统空余的内存空间/栈大小:能通过减少最大堆和减少栈容量来换取更多的线程

<4> 程序计数器

 

Native  memory

 

 

HotSpot VM: 3 memory spaces

The JVM HotSpot memory is split between 3 memory spaces:

·         The Java Heap
·         The PermGen (permanent generation) space
·         The Native Heap (C-Heap)



Memory Space
Start-up arguments and tuning
Monitoring strategies
Description
Java Heap
-Xmx (maximum Heap space)

-Xms (minimum Heap size)

EX:
-Xmx1024m
-Xms1024m
- verbose GC
- JMX API
- JConsole
- Other monitoring tools
The Java Heap is storing your primary Java program Class instances.
PermGen
-XX:MaxPermSize (maximum size)

-XX:PermSize
(minimum size)


EX:
-XX:MaxPermSize=512m
-XX:PermSize=256m
- verbose GC
- JMX API
- JConsole
- Other monitoring tools
The Java HotSpot VM permanent generation space is the JVM storage used mainly to store your Java Class objects such as names and method of the Classes, internal JVM objects and other JIT optimization related data.
Native Heap
 (C-Heap)
Not configurable directly.

For a 32-bit VM, the C-Heap capacity = 4 Gig – Java Heap - PermGen

For a 64-bit VM, the C-Heap capacity = Physical server total RAM & virtual memory – Java Heap - PermGen
- Total process size check in Windows and Linux
- pmap command on Solaris & Linux
- svmon command on AIX
The C-Heap is storing objects such as MMAP file, other JVM and third party native code objects.








  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值