Skip to content

Latest commit

ย 

History

History
129 lines (96 loc) ยท 7.87 KB

README.md

File metadata and controls

129 lines (96 loc) ยท 7.87 KB

Garbage Collection

Java๋Š” C, C++ ์–ธ์–ด์™€ ๋‹ฌ๋ฆฌ ๊ฐœ๋ฐœ์ž๊ฐ€ ๋ช…์‹œ์ ์œผ๋กœ ๊ฐ์ฒด๋ฅผ ํ•ด์ œํ•  ํ•„์š”๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.
Java์—์„œ๋Š” JVM(Java Virtual Machine)์ด ๊ตฌ์„ฑ๋œ JRE(Java Runtime Environment)๊ฐ€ ์ œ๊ณต๋ฉ๋‹ˆ๋‹ค.
JVM์—์„œ Garbage Collection์„ ์ˆ˜ํ–‰ํ•˜์—ฌ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” ๊ฐ์ฒด๋ฅผ ๋ฉ”๋ชจ๋ฆฌ์—์„œ ์‚ญ์ œํ•˜๋Š” ์ž‘์—…์„ ํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

๐Ÿ’ก stop-the-world
GC๋ฅผ ์‹คํ–‰ํ•˜๊ธฐ ์œ„ํ•ด JVM์ด ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์‹คํ–‰์„ ๋ฉˆ์ถ”๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.
์–ด๋–ค GC ์•Œ๊ณ ๋ฆฌ์ฆ˜์„ ์‚ฌ์šฉํ•˜๋”๋ผ๋„ ์ด๋Š” ๋ฐœ์ƒํ•˜๊ฒŒ ๋˜๋Š”๋ฐ, ๋Œ€๊ฐœ์˜ ๊ฒฝ์šฐ GC ํŠœ๋‹์€ ์ด ์‹œ๊ฐ„์„ ์ค„์ด๋Š” ๊ฒƒ์ด ์ค‘์š”ํ•ฉ๋‹ˆ๋‹ค.

๋‹ค์Œ๊ณผ ๊ฐ™์€ ๊ฒฝ์šฐ์— GC์˜ ๋Œ€์ƒ์ด ๋ฉ๋‹ˆ๋‹ค.

  1. ๊ฐ์ฒด๊ฐ€ Null์ธ ๊ฒฝ์šฐ
  2. ๋ธ”๋Ÿญ ์‹คํ–‰ ์ข…๋ฃŒ ํ›„, ๋ธ”๋Ÿญ ์•ˆ์—์„œ ์ƒ์„ฑ๋œ ๊ฐ์ฒด
  3. ๋ถ€๋ชจ ๊ฐ์ฒด๊ฐ€ Null์ธ ๊ฒฝ์šฐ, ํฌํ•จํ•˜๋Š” ์ž์‹ ๊ฐ์ฒด
๐Ÿ’ก GC ๋ฉ”๋ชจ๋ฆฌ ํ•ด์ œ ๊ณผ์ •
1. Marking: ํ”„๋กœ์„ธ์Šค๋Š” ๋งˆํ‚น์„ ํ˜ธ์ถœํ•˜์—ฌ ๋ฉ”๋ชจ๋ฆฌ๊ฐ€ ์‚ฌ์šฉ๋˜๋Š”์ง€ ์•„๋‹Œ์ง€ ์ฐพ์•„๋ƒ…๋‹ˆ๋‹ค. ๋ชจ๋“  ์˜ค๋ธŒ์ ํŠธ๊ฐ€ ์Šค์บ”๋˜๊ธฐ ๋•Œ๋ฌธ์— ๋งŽ์€ ์‹œ๊ฐ„์ด ์†Œ๋ชจ๋ฉ๋‹ˆ๋‹ค.
2. Mormal Deletion: ์ฐธ์กฐ๋˜์ง€ ์•Š๋Š” ๊ฐ์ฒด๋ฅผ ์ œ๊ฑฐํ•˜๊ณ  ๋ฉ”๋ชจ๋ฆฌ๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. ๋ฉ”๋ชจ๋ฆฌ Allocator๋Š” ๋ฐ˜ํ™˜๋˜์–ด ๋น„์–ด์ง„ ๋ธ”๋Ÿญ์˜ ์ฐธ์กฐ ์œ„์น˜๋ฅผ ์ €์žฅํ•ด ๋‘์—ˆ๋‹ค๊ฐ€ ์ƒˆ๋กœ์šด ์˜ค๋ธŒ์ ํŠธ๊ฐ€ ์„ ์–ธ๋˜๋ฉด ํ• ๋‹น๋˜๋„๋ก ํ•ฉ๋‹ˆ๋‹ค.
3. Compacting: ํผํฌ๋จผ์Šค ํ–ฅ์ƒ์„ ์œ„ํ•ด ์ฐธ์กฐ๋˜์ง€ ์•Š๋Š” ๊ฐ์ฒด๋ฅผ ์ œ๊ฑฐํ•˜๊ณ  ๋‚จ์€ ๊ฐ์ฒด๋“ค์„ ๋ฌถ์Œ์œผ๋กœ์„œ ์ƒˆ๋กœ์šด ๋ฉ”๋ชจ๋ฆฌ ํ• ๋‹น ์‹œ ๋” ์‰ฝ๊ฒŒ ๋น ๋ฅด๊ฒŒ ์ง„ํ–‰๋  ์ˆ˜ ์žˆ๋„๋ก ํ•ฉ๋‹ˆ๋‹ค.

Weak Generational Hypothesis

์œ„ GC ๋ฉ”๋ชจ๋ฆฌ ํ•ด์ œ ๊ณผ์ •๊ณผ ๊ฐ™์ด ๋ชจ๋“  ๊ฐ์ฒด๋ฅผ Mark & Compack ํ•˜๋Š” JVM์€ ๋น„ํšจ์œจ์ ์ž…๋‹ˆ๋‹ค.
์•„๋ž˜ ๊ทธ๋ž˜ํ”„์—์„œ Y์ถ•์€ ํ• ๋‹น๋œ ๋ฐ”์ดํŠธ์˜ ์ˆ˜, X์ถ•์€ ๋ฐ”์ดํŠธ๊ฐ€ ํ• ๋‹น๋  ๋•Œ์˜ ์‹œ๊ฐ„์„ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค.

์œ„ ๊ทธ๋ž˜ํ”„์™€ ๊ฐ™์ด ์‹œ๊ฐ„์ด ๊ฐˆ์ˆ˜๋ก ์ ์€ ๊ฐ์ฒด๋งŒ ๋‚จ๋Š” ๋‹ค๋Š” ๊ฒƒ์ด ์•ฝํ•œ ์„ธ๋Œ€ ๊ฐ€์„ค์ž…๋‹ˆ๋‹ค.

์‹ ๊ทœ๋กœ ์ƒ์„ฑํ•œ ๊ฐ์ฒด์˜ ๋Œ€๋ถ€๋ถ„์€ ๊ธˆ๋ฐฉ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” ์ƒํƒœ๊ฐ€ ๋˜๊ณ , ์˜ค๋ž˜๋œ ๊ฐ์ฒด์—์„œ ์‹ ๊ทœ ๊ฐ์ฒด๋กœ์˜ ์ฐธ์กฐ๋Š” ๋งค์šฐ ์ ๊ฒŒ ์กด์žฌํ•œ๋‹ค๋Š” ๊ฐ€์„ค์ž…๋‹ˆ๋‹ค.
์ด ๊ฐ€์„ค์— ๊ธฐ๋ฐ˜ํ•˜์—ฌ ์ž๋ฐ”๋Š” Young ์˜์—ญ๊ณผ Old ์˜์—ญ์œผ๋กœ ๋ฉ”๋ชจ๋ฆฌ๋ฅผ ๋ถ„ํ• ํ•˜์—ฌ
์‹ ๊ทœ๋กœ ์ƒ์„ฑ๋˜๋Š” ๊ฐ์ฒด๋Š” Young ์˜์—ญ์—, ์˜ค๋žซ๋™์•ˆ ์‚ด์•„๋‚จ์€ ๊ฐ์ฒด๋Š” Old ์˜์—ญ์— ๋ณด๊ด€ํ•ฉ๋‹ˆ๋‹ค.

Generational Gabage Collection

JVM์˜ ๋ฉ”๋ชจ๋ฆฌ๋Š” ์ด class, stack, heap, native method, PC, 5๊ฐ€์ง€ ์˜์—ญ์œผ๋กœ ๋‚˜๋‰˜๋Š”๋ฐ, GC๋Š” ํž™ ๋ฉ”๋ชจ๋ฆฌ๋งŒ ๋‹ค๋ฃน๋‹ˆ๋‹ค.


  1. Young Generation ์˜์—ญ
    ์ƒˆ๋กญ๊ฒŒ ์ƒ์„ฑํ•œ ๊ฐ์ฒด๊ฐ€ ์œ„์น˜ํ•˜๋Š” ๊ณณ์œผ๋กœ ๋งŽ์€ ๊ฐ์ฒด๊ฐ€ ์ƒ์„ฑ๋˜์—ˆ๋‹ค๊ฐ€ ์‚ฌ๋ผ์ง€๋Š” ์˜์—ญ์ž…๋‹ˆ๋‹ค.
    ์ด ์˜์—ญ์—์„œ ๊ฐ์ฒด๊ฐ€ ์‚ฌ๋ผ์งˆ ๋•Œ Minor GC๊ฐ€ ๋ฐœ์ƒํ•œ๋‹ค๊ณ  ๋งํ•ฉ๋‹ˆ๋‹ค.
  2. Old Generation ์˜์—ญ
    ์ ‘๊ทผ ๋ถˆ๊ฐ€๋Šฅ ์ƒํƒœ๋กœ ๋˜์ง€ ์•Š๊ณ  Young ์˜์—ญ์—์„œ ์‚ด์•„๋‚จ์€ ๊ฐ์ฒด๊ฐ€ ์—ฌ๊ธฐ๋กœ ๋ณต์‚ฌ๋ฉ๋‹ˆ๋‹ค.
    Young ์˜์—ญ๋ณด๋‹ค ํฌ๊ฒŒ ํ• ๋‹นํ•˜๋ฉฐ ํฌ๊ธฐ๊ฐ€ ํฐ ๋งŒํผ GC๋Š” ์ ๊ฒŒ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.
    ์ด ์˜์—ญ์—์„œ ๊ฐ์ฒด๊ฐ€ ์‚ฌ๋ผ์งˆ ๋•Œ Major GC ๋˜๋Š” Full GC๊ฐ€ ๋ฐœ์ƒํ•œ๋‹ค๊ณ  ๋งํ•ฉ๋‹ˆ๋‹ค.
  3. Permanent ์˜์—ญ
    Methods Area๋ผ๊ณ ๋„ ํ•˜๋ฉฐ, JVM์ด ํด๋ž˜์Šค๋“ค๊ณผ ๋ฉ”์†Œ๋“œ๋“ค์„ ์„ค๋ช…ํ•˜๊ธฐ ์œ„ํ•ด ํ•„์š”ํ•œ ๋ฉ”ํƒ€ ๋ฐ์ดํ„ฐ๋“ค์„ ํฌํ•จํ•˜๋Š” ์˜์—ญ์ž…๋‹ˆ๋‹ค.
    JDK8๋ถ€ํ„ฐ๋Š” Meta Space๋กœ ๊ต์ฒด๋ฉ๋‹ˆ๋‹ค.
โœ… Generational Gabage Collection ๊ณผ์ •
1. ์ƒˆ๋กœ์šด ๊ฐ์ฒด๊ฐ€ ๋“ค์–ด์˜ค๋ฉด Eden Space์— ํ• ๋‹นํ•ฉ๋‹ˆ๋‹ค.
2. Eden Space๊ฐ€ ๊ฐ€๋“์ฐจ๋ฉด Minor Garbage Collection์ด ์‹œ์ž‘๋ฉ๋‹ˆ๋‹ค.
3. ์ฐธ์กฐ์ค‘์ธ ๊ฐ์ฒด๋Š” Survivor1 ์˜์—ญ์œผ๋กœ, ๋น„ ์ฐธ์กฐ ๊ฐ์ฒด๋Š” Eden Spacerk Clear๋  ๋•Œ ๋ฐ˜ํ™˜๋ฉ๋‹ˆ๋‹ค.
4. ๋‹ค์Œ Minor GC ๋•Œ ์ฐธ์กฐ ๊ฐ์ฒด๋Š” Survivor2 ์˜์—ญ์œผ๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค. ์ฐธ์กฐ ๊ฐ์ฒด๋“ค์ด ๋ชจ๋‘ Survivor2 ์˜์—ญ์œผ๋กœ ์ด๋™ํ•˜๊ฒŒ ๋˜๋ฉด Eden Space์™€ Survivor1 ์˜์—ญ์€ Clear ๋ฉ๋‹ˆ๋‹ค. ์ฃผ์˜ํ•  ์ ์€ ๋‹ค๋ฅธ age๋ฅผ ๊ฐ€์ง„ ๊ฐ์ฒด๋“ค์„ ํ•œ ๊ณต๊ฐ„์— ๊ฐ€์ง€๊ฒŒ ๋˜์—ˆ๋‹ค๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.
5. ๋‹ค์Œ Minor GC ์—์„œ๋Š” ์ฐธ์กฐ ๊ฐ์ฒด๋“ค์ด Survivor1 ์˜์—ญ์œผ๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค. ์ด๋ ‡๊ฒŒ ๊ณ„์† ๋‘ ๊ณต๊ฐ„์„ ๋ฒˆ๊ฐˆ์•„๊ฐ€๋ฉฐ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
6. Minor GC ํ›„ Survivor ์˜์—ญ์ด ๊ฐ€๋“์ฐจ๊ฑฐ๋‚˜ ๋˜๋Š” ๊ฐ์ฒด๋“ค์ด ์ผ์ •ํ•œ age threshold๋ฅผ ๋„˜๊ฒŒ ๋˜๋ฉด Old ์˜์—ญ์œผ๋กœ Promition ๋ฉ๋‹ˆ๋‹ค.
7. Major Gsms Old Generation์—์„œ ์‹คํ–‰ ํ›„ Clear ๋˜๊ณ  ๊ณต๊ฐ„์ด Compact ๋ฉ๋‹ˆ๋‹ค.

Serial GC (-XX:+UseSerialGC)

๊ฐ€์žฅ ๋‹จ์ˆœํ•œ ๋ฐฉ์‹์˜ GC๋กœ ์‹ฑ๊ธ€ ์Šค๋ ˆ๋“œ๋กœ ๋™์ž‘ํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๊ทธ๋งŒํผ stop-the-world ์‹œ๊ฐ„์ด ๊น๋‹ˆ๋‹ค.
Mark & Sweep & Compact ์•Œ๊ณ ๋ฆฌ์ฆ˜์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

ParallelGC (-XX:+UseParallelGC)

Java 8์˜ default GC๋กœ, Young ์˜์—ญ์˜ GC๋ฅผ ๋ฉ€ํ‹ฐ ์Šค๋ ˆ๋“œ ๋ฐฉ์‹์œผ๋กœ ์‚ฌ์šฉํ•˜๊ธฐ ๋•Œ๋ฌธ์— Serial GC๋ณด๋‹ค stop-the-world ๊ฐ€ ์งง์Šต๋‹ˆ๋‹ค.
Old Generation ์˜์—ญ์—์„œ๋งŒ Full GC(๊ณต๊ฐ„ ์žฌํ™•๋ณด ๋ฐ ์กฐ๊ฐ ๋ชจ์Œ) ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค.

Parallel Old GC (-XX:+UseParallelOldGC / -XX:+ParallelGCThreads=n)

Old ์˜์—ญ๊นŒ์ง€ ๋ฉ€ํ‹ฐ ์Šค๋ ˆ๋“œ ๋ฐฉ์‹์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์œผ๋กœ -XX:+ParallelGCThreads=n ์˜ต์…˜์„ ํ†ตํ•ด ๋ฉ€ํ‹ฐ ์Šค๋ ˆ๋“œ ๊ฐœ์ˆ˜๋ฅผ ์ง€์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

CMS GC(Concurrent Mark Sweep GC)

Stop The World๋กœ Java Application์ด ๋ฉˆ์ถ”๋Š” ํ˜„์ƒ์„ ์ค„์ด๊ณ ์ž ๋งŒ๋“  GC๋กœ,
4 ๋‹จ๊ณ„๋กœ ๋‚˜๋ˆ„์–ด Reacable ํ•œ ๊ฐ์ฒด๋ฅผ ํ•œ๋ฒˆ์— ์ฐพ์ง€ ์•Š๊ณ  ๋‚˜๋ˆ ์„œ ์ฐพ๋Š” ๋ฐฉ์‹์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

  1. Initial Mark: GC Root๊ฐ€ ์ฐธ์กฐํ•˜๋Š” ๊ฐ์ฒด๋งŒ ๋งˆํ‚นํ•ฉ๋‹ˆ๋‹ค. (stop-the-world ๋ฐœ์ƒ)
  2. Concurrent Mark: ์ฐธ์กฐํ•˜๋Š” ๊ฐ์ฒด๋ฅผ ๋”ฐ๋ผ๊ฐ€๋ฉฐ, ์ง€์†์ ์œผ๋กœ ๋งˆํ‚นํ•ฉ๋‹ˆ๋‹ค. (stop-the-world ์—†์ด ์ˆ˜ํ–‰)
  3. Remark: concurrent mark ๊ณผ์ •์—์„œ ๋ณ€๊ฒฝ๋œ ์‚ฌํ•ญ์ด ์—†๋Š”์ง€ ๋‹ค์‹œ ํ•œ๋ฒˆ ๋งˆํ‚นํ•˜๋ฉฐ ํ™•์ •ํ•˜๋Š” ๊ณผ์ •์„ ์ง„ํ–‰ํ•ฉ๋‹ˆ๋‹ค. (stop-the-world ๋ฐœ์ƒ)
  4. Concurrent Sweep: ์ ‘๊ทผํ•  ์ˆ˜ ์—†๋Š” ๊ฐ์ฒด๋ฅผ ์ œ๊ฑฐํ•˜๋Š” ๊ณผ์ •์„ ์ง„ํ–‰ํ•ฉ๋‹ˆ๋‹ค. (stop-the-world ์—†์ด ์ˆ˜ํ–‰)

CMS๋Š” Old Generation์˜ ์กฐ๊ฐ ๋ชจ์Œ(Compaction)์„ ํ•˜์ง€ ์•Š์œผ๋ฏ€๋กœ Full GC ์‹œ๊ฐ„์ด ๊ธธ์–ด์ง€๋Š” ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.

G1 GC (Garbage Frist GC) (-XX:+UseG1GC)

Java 9 ์ด์ƒ์˜ ๋ฒ„์ „์—์„œ default GC๋กœ, ํ˜„์žฌ GC ์ค‘ stop-the-world์˜ ์‹œ๊ฐ„์ด ์ œ์ผ ์งง์Šต๋‹ˆ๋‹ค.
CMS GC ๋ฅผ ๊ฐœ์„ ํ•˜์—ฌ ๋งŒ๋“  GC๋กœ ๋‹ค๋ฅธ GC์™€ ๋‹ค๋ฅด๊ฒŒ ์ „์ฒด ํž™ ๊ณต๊ฐ„์„ ์ฒด์ŠคํŒ์ฒ˜๋Ÿผ Region ์ด๋ผ๋Š” ์˜์—ญ์œผ๋กœ ๋‚˜๋ˆ„์–ด ๊ด€๋ฆฌํ•ฉ๋‹ˆ๋‹ค.

์ „์ฒด Heap์— ๋Œ€ํ•ด์„œ ํƒ์ƒ‰ํ•˜์ง€ ์•Š๊ณ  ๋ถ€๋ถ„์ ์œผ๋กœ Region ๋‹จ์œ„๋กœ ํƒ์ƒ‰ํ•˜์—ฌ, ๊ฐ๊ฐ์˜ Region์—๋งŒ GC๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.
Young๊ณผ Old ์˜์—ญ์˜ ๊ตฌ๋ถ„์ด ์—†์œผ๋ฉฐ, ์˜์—ญ์˜ ์ฐธ์กฐ๋ฅผ ๊ด€๋ฆฌํ•  ๋ชฉ์ ์œผ๋กœ Remember Set์„ ๋งŒ๋“ค์–ด ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. (์ „์ฒด ํž™์˜ 5% ๋ฏธ๋งŒ์˜ ํฌ๊ธฐ)
ํฐ ๋ฉ”๋ชจ๋ฆฌ๋ฅผ ๊ฐ€์ง„ ๋ฉ€ํ‹ฐ ํ”„๋กœ์„ธ์Šค ์‹œ์Šคํ…œ์— ์ ํ•ฉํ•ฉ๋‹ˆ๋‹ค.

๐Ÿ’ก G1 GC ๋™์ž‘ ๊ณผ์ •
Young ์˜์—ญ(Eden, Survivor)์—์„œ๋Š” Young GC๊ฐ€ ์ˆ˜ํ–‰๋˜๋ฉฐ Eden, Survivor ์˜์—ญ ์ด๋™
์˜ฎ๊ธฐ๋ฉด์„œ ๋น„์›Œ์ง„ ์˜์—ญ์€ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ๋นˆ ์˜์—ญ์œผ๋กœ ๋˜๋Œ๋ฆผ

โœ… Full GC ์ˆ˜ํ–‰ ๋‹จ๊ณ„
Initial Mark -> Root Region Scan -> Concurrent Mark -> Remark -> Cleanup -> Copy

- Initial Mark
  Old ์ง€์—ญ์— ์กด์žฌํ•˜๋Š” ๊ฐ์ฒด๊ฐ€ ์ฐธ์กฐํ•˜๋Š” Survivor ์˜์—ญ ํƒ์ƒ‰
  STW ๋ฐœ์ƒ

- Root Region Scan
  ์ด์ „ ๋‹จ๊ณ„์—์„œ ์ฐพ์€ ์˜์—ญ์— ๋Œ€ํ•œ GC ๋Œ€์ƒ ๊ฐ์ฒด ์Šค์บ”

- Concurrent Mark
  ์ „์ฒด ํž™ ์˜์—ญ ์Šค์บ”
  GC ๋Œ€์ƒ ๊ฐ์ฒด๊ฐ€ ์—†๋Š” ์˜์—ญ์€ ์ดํ›„ ๋‹จ๊ณ„์—์„œ ์ œ์™ธ

- Remark
  STW๊ฐ€ ๋ฐœ์ƒํ•˜๋ฉฐ ์ตœ์ข…์œผ๋กœ GC ๋Œ€์ƒ์—์„œ ์ œ์™ธํ•  ๊ฐ์ฒด ์‹๋ณ„

- Cleanup
  STW๊ฐ€ ๋ฐœ์ƒํ•˜๋ฉฐ ์ œ๊ฑฐํ•  ๊ฐ์ฒด๊ฐ€ ๊ฐ€์žฅ ๋งŽ์€ ์ง€์—ญ์—์„œ GC ์ˆ˜ํ–‰
  ์™„๋ฃŒ ํ›„, ์™„์ „ํžˆ ๋น„์›Œ์ง„ ์˜์—ญ์„ ์žฌ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด Freelist์— ์ถ”๊ฐ€

- Copy
  GC ๋Œ€์ƒ์ด์—ˆ์ง€๋งŒ Cleanup ๋‹จ๊ณ„์—์„œ ์™„์ „ํžˆ ๋น„์›Œ์ง€์ง€ ์•Š์€ ์ง€์—ญ์˜ ๋‚จ์€ ๊ฐ์ฒด๋ฅผ ์ƒˆ๋กœ์šด ์˜์—ญ์— ๋ณต์‚ฌํ•˜์—ฌ ์กฐ๊ฐ ๋ชจ์Œ(Compaction) ์ž‘์—… ์ˆ˜ํ–‰