java GC 回收机制

java GC 回收机制
GC回收机制

The Heap is divided into young and old generations as follows :
堆分为年轻代和老年代,如下:
Young Generation : It is place where lived for short period and divided into two spaces:
● Eden Space : When object created using new keyword memory allocated on this space.
● Survivor Space : This is the pool which contains objects which have survived after java garbage collection from Eden space.
年轻代:这个是短期存放的地方,可以分为两个部分:
● Eden Space: 当用new关键字创建对象时,在这个空间分配内存。
● Survivor Space:这个池用来存放,从Eden Space垃圾回收后存活的对象。

Old Generation : This pool is basically contain tenured and virtual (reserved) space and will be holding those objects which survived after garbage collection from Young Generation.
● Tenured Space: This memory pool contains objects which survived after multiple garbage collection means object which survived after garbage collection from Survivor space.
老年代:这个池基本上包含永久空间和虚拟空间,用来存放从年轻代垃圾回收后存活的对象。
● 永久空间:这个内存池包含从年轻代和老年代垃圾回收后存活的对象。

Permanent Generation : This memory pool as name also says contain permanent class metadata and descriptors information so PermGen space always reserved for classes and those that is tied to the classes for example static members.
Java8 Update: PermGen is replaced with Metaspace which is very similar.
Main difference is that Metaspace re-sizes dynamically i.e., It can expand at runtime.
Java Metaspace space: unbounded (default)
永久代:这个内存池像它的名字所说的一样,是用来存放永久class 元数据和描述符信息的。所以永久代空间总是保留类和他相关的类。例如静态成员。

Code Cache (Virtual or reserved) : If you are using HotSpot Java VM this includes code cache area that containing memory which will be used for compilation and storage of native code.
代码缓存:如果你用的是热点 java 虚拟器,就会包含代码缓存区域,这个区域的内存会用来编译和保存本地代码。

这里写图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值