java JVM

本文深入探讨了Java垃圾回收机制的各个部分,包括年轻代、持久代和永久代的作用,以及全垃圾回收(Full GC)的概念。通过理解这些概念,读者能够更好地掌握Java内存管理和垃圾收集的过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. Generations for Garbage Collection info:

 

Java objects are created in Heap and Heap is divided into three parts, these are called as Young generation, Tenured or Old Generation and Perm Area

 

1. young Generation is further divided into three parts known as Eden spaceSurvivor 1 and Survivor 2 space. When an object first created in heap its gets created in new generation inside Eden space and after subsequent Minor Garbage collection if object survives its gets moved to survivor 1 and then Survivor 2

 

2. before Major Garbage collection moved that object to Old or tenured generation.

 

3. Permanent generation of Heap is somewhat special and it is used to store Meta data related to classes and method in JVM, it also hosts String pool provided by JVM 

 

2.  full GC 

 

a single garbage collector thread that runs concurrently with the application threads with the goal of completing the collection of the tenured generation before it becomes full. In normal operation, the concurrent garbage collector is able to do most of its work with the application threads still running, so only brief pauses are seen by the application threads. if the concurrent garbage collector is unable to finish before the tenured generation fill up, the application is paused with all the application threads stopped. Such Collections with the application stopped are referred as full garbage collections or full GC 

 

http://javarevisited.blogspot.hk/2011/04/garbage-collection-in-java.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值