SlideShare ist ein Scribd-Unternehmen logo
1 von 20
GARBAGE COLLECTION
      인프라개발팀 이준희
GC란?


Garbage Collection

Automatic Memory Management

더 이상 사용하지 않는 메모리 개체를 찾아 다시 사용 가
능한 자원으로 자동적으로 회수하는 것
GC 활용


Lisp 최초의 GC

Java, Smalltalk, C#, VB.net, Python, Javascript, Actionscript,
Objective-C
GC 장단점
장점

메모리 관련 오류 방지

프로그램 복잡도를 낮춰주는 효과

단점

GC로 인한 Overhead 발생

세밀한 메모리 관리 불가
GC On JVM



GC를 알기전에 JVM Heap 부터..
JVM Heap
GC
process
GC의 종류



Major GC : Old(tenured) 영역에서 발생

Minor GC : Young or Perm 영역에서 발생
4가지 GC방식

Serial Collector

Parallel Collector

Parallel Compacting Collector

Concurrent Mark-Sweep Collector
Serial Collector




       promotion
Serial Collector

Mark-Sweep-Compact Collection Algorithm
Serial Collector


단일 CPU를 사용하며, GC수행시 어플리케이션 정지됨
(Stop The World)

주로 클라이언트 장비에서 사용됨

-XX:+UseSerialGC
Parallel Collector
Parallel Collector

멀티프로세서 시스템에서 여러개의 Collector를 동시에
실행함

Major GC는 Serial방식과 동일

각 Collector의 Minor GC도 Serial방식과 동일

-XX:+UseParallelGC
Parallel Compacting Collector

Major GC를 parallel하게 수행하여 성능을 높임

Minor GC는 Parallel Collector와 동일

JDK5 update6 버전부터 사용가능함

-XX:+UseParallelOldGC
Concurrent Mark-Sweep
      Collector
Concurrent Mark-Sweep
          Collector

Minor GC는 Parallel Collector와 동일함

Major GC의 4단계
- initial mark
- concurrent mark
- remark
- concurrent sweep
Concurrent Mark-Sweep
         Collector

짧게 멈추면서 자주 GC하는 방식
(전체적인 GC에 걸리는 시간은 짧지는 않음)

GC로 인한 대기시간 발생을 최소화하는 것이 목적

빠른 응답이 필요한 WebServer와 같은 환경에 적합

-XX:+UseConcMarkSweepGC
G1 Garbage Collector

JDK7(JDK6 update14부터) 포함된 새로운 GC

대규모 시스템에 적합하도록 설계되었음

기존 CMS 방식의 이슈 해결
-> 대용량 메모리(2G이상) 환경에서 Full GC로 인한 성능
저하 발생

Weitere ähnliche Inhalte

Ähnlich wie About gc

IBM JVM GC_Wh apm
IBM JVM GC_Wh apmIBM JVM GC_Wh apm
IBM JVM GC_Wh apm엑셈
 
Java performance and trouble shooting
Java performance and trouble shootingJava performance and trouble shooting
Java performance and trouble shootingAnna Choi
 
웨일브라우저 성능 및 메모리 최적화
웨일브라우저 성능 및 메모리 최적화웨일브라우저 성능 및 메모리 최적화
웨일브라우저 성능 및 메모리 최적화NAVER D2
 
(알도개) GraalVM – 자바를 넘어선 새로운 시작의 서막
(알도개) GraalVM – 자바를 넘어선 새로운 시작의 서막(알도개) GraalVM – 자바를 넘어선 새로운 시작의 서막
(알도개) GraalVM – 자바를 넘어선 새로운 시작의 서막Jay Park
 
Hotspot JVM GC_Wh apm
Hotspot JVM GC_Wh apmHotspot JVM GC_Wh apm
Hotspot JVM GC_Wh apm엑셈
 
Serverless Architecture with Cloud Function
Serverless Architecture with Cloud FunctionServerless Architecture with Cloud Function
Serverless Architecture with Cloud FunctionHarrison Jung
 
모바일 Rpg 게임서버 제작
모바일 Rpg 게임서버 제작모바일 Rpg 게임서버 제작
모바일 Rpg 게임서버 제작기환 천
 
도커(Docker) 메트릭스 & 로그 수집
도커(Docker) 메트릭스 & 로그 수집도커(Docker) 메트릭스 & 로그 수집
도커(Docker) 메트릭스 & 로그 수집Daegwon Kim
 
Cassandra 멘붕기 | Devon 2012
Cassandra 멘붕기 | Devon 2012Cassandra 멘붕기 | Devon 2012
Cassandra 멘붕기 | Devon 2012Daum DNA
 
[2018] Java를 위한, Java에 의한 도구들
[2018] Java를 위한, Java에 의한 도구들[2018] Java를 위한, Java에 의한 도구들
[2018] Java를 위한, Java에 의한 도구들NHN FORWARD
 
[NDC2015] 언제 어디서나 프로파일링 가능한 코드네임 JYP 작성기 - 라이브 게임 배포 후에도 프로파일링 하기
[NDC2015] 언제 어디서나 프로파일링 가능한 코드네임 JYP 작성기 - 라이브 게임 배포 후에도 프로파일링 하기[NDC2015] 언제 어디서나 프로파일링 가능한 코드네임 JYP 작성기 - 라이브 게임 배포 후에도 프로파일링 하기
[NDC2015] 언제 어디서나 프로파일링 가능한 코드네임 JYP 작성기 - 라이브 게임 배포 후에도 프로파일링 하기Jaeseung Ha
 
JVM Memory And GC Tuning Test
JVM Memory And GC Tuning Test JVM Memory And GC Tuning Test
JVM Memory And GC Tuning Test 승린 이
 
The MongoDB Strikes Back / MongoDB 의 역습
The MongoDB Strikes Back / MongoDB 의 역습The MongoDB Strikes Back / MongoDB 의 역습
The MongoDB Strikes Back / MongoDB 의 역습Hyun-woo Park
 
V8 engine internal
V8 engine internalV8 engine internal
V8 engine internalJinhyuck Kim
 

Ähnlich wie About gc (14)

IBM JVM GC_Wh apm
IBM JVM GC_Wh apmIBM JVM GC_Wh apm
IBM JVM GC_Wh apm
 
Java performance and trouble shooting
Java performance and trouble shootingJava performance and trouble shooting
Java performance and trouble shooting
 
웨일브라우저 성능 및 메모리 최적화
웨일브라우저 성능 및 메모리 최적화웨일브라우저 성능 및 메모리 최적화
웨일브라우저 성능 및 메모리 최적화
 
(알도개) GraalVM – 자바를 넘어선 새로운 시작의 서막
(알도개) GraalVM – 자바를 넘어선 새로운 시작의 서막(알도개) GraalVM – 자바를 넘어선 새로운 시작의 서막
(알도개) GraalVM – 자바를 넘어선 새로운 시작의 서막
 
Hotspot JVM GC_Wh apm
Hotspot JVM GC_Wh apmHotspot JVM GC_Wh apm
Hotspot JVM GC_Wh apm
 
Serverless Architecture with Cloud Function
Serverless Architecture with Cloud FunctionServerless Architecture with Cloud Function
Serverless Architecture with Cloud Function
 
모바일 Rpg 게임서버 제작
모바일 Rpg 게임서버 제작모바일 Rpg 게임서버 제작
모바일 Rpg 게임서버 제작
 
도커(Docker) 메트릭스 & 로그 수집
도커(Docker) 메트릭스 & 로그 수집도커(Docker) 메트릭스 & 로그 수집
도커(Docker) 메트릭스 & 로그 수집
 
Cassandra 멘붕기 | Devon 2012
Cassandra 멘붕기 | Devon 2012Cassandra 멘붕기 | Devon 2012
Cassandra 멘붕기 | Devon 2012
 
[2018] Java를 위한, Java에 의한 도구들
[2018] Java를 위한, Java에 의한 도구들[2018] Java를 위한, Java에 의한 도구들
[2018] Java를 위한, Java에 의한 도구들
 
[NDC2015] 언제 어디서나 프로파일링 가능한 코드네임 JYP 작성기 - 라이브 게임 배포 후에도 프로파일링 하기
[NDC2015] 언제 어디서나 프로파일링 가능한 코드네임 JYP 작성기 - 라이브 게임 배포 후에도 프로파일링 하기[NDC2015] 언제 어디서나 프로파일링 가능한 코드네임 JYP 작성기 - 라이브 게임 배포 후에도 프로파일링 하기
[NDC2015] 언제 어디서나 프로파일링 가능한 코드네임 JYP 작성기 - 라이브 게임 배포 후에도 프로파일링 하기
 
JVM Memory And GC Tuning Test
JVM Memory And GC Tuning Test JVM Memory And GC Tuning Test
JVM Memory And GC Tuning Test
 
The MongoDB Strikes Back / MongoDB 의 역습
The MongoDB Strikes Back / MongoDB 의 역습The MongoDB Strikes Back / MongoDB 의 역습
The MongoDB Strikes Back / MongoDB 의 역습
 
V8 engine internal
V8 engine internalV8 engine internal
V8 engine internal
 

Kürzlich hochgeladen

캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차캐드앤그래픽스
 
Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)Wonjun Hwang
 
A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)Tae Young Lee
 
Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)Wonjun Hwang
 
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...Kim Daeun
 
MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution DetectionMOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution DetectionKim Daeun
 

Kürzlich hochgeladen (6)

캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차
 
Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)
 
A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)
 
Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)
 
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
 
MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution DetectionMOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
 

About gc

Hinweis der Redaktion

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n