HomeAboutMeBlogGuest
© 2025 Sejin Cha. All rights reserved.
Built with Next.js, deployed on Vercel
🍗
[New] 조규현팀
/
🔦
jvm 2부 [Gabage Collector]
/
🏓
마이너 GC는 Copy & Scavenge 다???? (1)
🏓

마이너 GC는 Copy & Scavenge 다???? (1)

발단

  • Young Generation에서 일어나는 GC를 마이너 GC 라고 합니다.
  • Young에서 마이너 GC가 발생하면 Copy & Scavenge 방법, Old 영역에서는 MarkSweepCompact 방법이라 공부했습니다.
  • 팀원들은 Young과 Old 모두 MarkSweepCompact 알고 계셨고, Copy & Scavenge 를 공부하면서 본 적 없다는 … 의견이 달랐습니다.

본론

💫 Copy & Scavenge ?

notion image
  • 위와 같은 과정을 Copy(복사하고) & Scavenge(clear한다) 라고 합니다.
  • 객체를 복사하고 영역을 비우는 작업을 반복적으로 수행
  • 속도가 비교적 빠르고, 작은 크기의 메모리를 Collecting 하는데 효과적
 

말이 다 달라서 헷갈려 !

  • 해당 부분은 스터디 준비를 할 때도 이동한다 , 복사한다 로 말이 다 달라서 의문이 들었습니다.
 

그래서 뭐가 맞는 건가 ?

  • 저도 아직 잘 모르겠습니다.. ㅎ 알게 되신다면 알려주세욤 ..
  • 확실한 첫 번째는 survivor에서 이동이 아닌 복사한다는 것 입니다 ! 복사를 한다면 원본을 어떻게 정리를 하긴 해야 할텐데 말이죠 ..
    • oracle docs에서 검색해봤을 땐 해당 부분이 자세히 나오지 않았습니다. Young Generation 에서 “The one space recently filled is a source of live objects that are copied into the other survivor space.” 복사 되었다는 것을 확인 할 수 있었습니다.
  • 두 번째는 Old 영역은 MarkSweepCompact 가 확실합니다 !
  • 또 다른 링크에는 GC 종류에 따라 다른 종류를 보여주고 있는 것 같습니다.
 
HotSpot Virtual Machine Garbage Collection Tuning Guide
HotSpot Virtual Machine Garbage Collection Tuning Guide Garbage Collector Implementation One strength of the Java SE platform is that it shields the developer from the complexity of memory allocation and garbage collection. However, when garbage collection is the principal bottleneck, it's useful to understand some aspects of the implementation.
HotSpot Virtual Machine Garbage Collection Tuning Guide
https://docs.oracle.com/en/java/javase/18/gctuning/garbage-collector-implementation.html#GUID-16166ED9-32C6-402D-BB22-FD85BCB04E57
HotSpot Virtual Machine Garbage Collection Tuning Guide
Oracle JVM Garbage Collectors Available From JDK 1.7.0_04 And After
Our valued sponsors who help make this site possible JProfiler: Get rid of your performance problems and memory leaks! Training online: Concurrency, Threading, GC, Advanced Java and more ... Oracle JVM Garbage Collectors Available From JDK 1.7.0_04 And After Jack Shirazi tells you what garbage collectors and garbage collector combinations are available from the Oracle Java 7 update 4 JVM and onwards, including Java 8 and Java 9.
Oracle JVM Garbage Collectors Available From JDK 1.7.0_04 And After
http://www.fasterj.com/articles/oraclecollectors1.shtml
Oracle JVM Garbage Collectors Available From JDK 1.7.0_04 And After