kui-vault/06.Archive/aimSystems/Computer Science/GC (Garbage Collection)/Minor GC.md

12 lines
877 B
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

새로 생성된 객체가 위치하는 Young 영역에서 발생
- Eden([[Young Generation]]) 영역의 GC
- Eden 영역 1개와 Survivor 영역 2개를 이용해 Copy & Scavenge 방식으로 GC를 진행
##### 1st GC
- 새로 생성된 대부분의 객체는 Eden 영역에 위치
- Eden 영역이 차게 되면 Minor GC가 발생하게 되며 살아남은 객체는 Survivor 영역 중 하나로 이동
- 이후 Eden 영역에서 GC가 발생하면 기존에 살아남은 객체가  존재하는 Survivor 영역 쪽으로 계속 쌓임
##### 2nd GC
- 하나의 Survivor 영역이 가득 차게 되면  중에 살아남은  객체를 다른 Survivor 영역으로 이동하며, 가득 찼던 Survivor  영역은 데이터가 없는 상태가 
- 이 과정을 반복하다가 계속해서 살아남아 있는 객체는 Old  영역으로 이동