Garbage Collectors
Java Garbage collectors
Overview
In the Java platform, there are currently four supported garbage collection alternatives and all but one of them, the serial GC, parallelise the work to improve performance.
Shenandoah
low-latency GC
operates mostly concurrently with application
ZGC
a low-latency concurrent GC introduced in Java 11
G1 (Garbage first) GC
default GC from Java 9 onwards
![](https://amartyushov.gitbook.io/~gitbook/image?url=https%3A%2F%2F415484505-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-LxtoAXZwwOc4XGto8vb%252Fuploads%252FivtyOtEIMVIg63ezWDIB%252FScreenshot%25202023-12-20%2520at%252020.49.58.png%3Falt%3Dmedia%26token%3De4c9d979-7f73-4828-b0cf-8e4110ddaa3a&width=768&dpr=4&quality=100&sign=97fa8653&sv=1)
![](https://amartyushov.gitbook.io/~gitbook/image?url=https%3A%2F%2F415484505-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-LxtoAXZwwOc4XGto8vb%252Fuploads%252FPTmGrTr6lhJrwfecSEFH%252FScreenshot%25202023-12-20%2520at%252020.50.45.png%3Falt%3Dmedia%26token%3Db52b66a0-8703-46dc-9f91-cc900f3edf0d&width=768&dpr=4&quality=100&sign=b0829120&sv=1)
Parallel GC
Uses multiple threads for minor collections
Uses single thread for major collection
âšī¸GC progress from JDK 8 to JDK 17
![](https://amartyushov.gitbook.io/~gitbook/image?url=https%3A%2F%2F415484505-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-LxtoAXZwwOc4XGto8vb%252Fuploads%252FTaB7NVgnKnhYoUsR6mP9%252FScreenshot%25202022-08-30%2520at%252009.09.41.png%3Falt%3Dmedia%26token%3D2ce6dae7-743e-45e9-8229-5f543c28f44a&width=768&dpr=4&quality=100&sign=1894ed3f&sv=1)
![](https://amartyushov.gitbook.io/~gitbook/image?url=https%3A%2F%2F415484505-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-LxtoAXZwwOc4XGto8vb%252Fuploads%252FAK3X7rodsgevSQWcNxlq%252FScreenshot%25202022-08-30%2520at%252009.10.56.png%3Falt%3Dmedia%26token%3Daa6ea851-5c4b-4947-b2ca-7c9bc63b69a7&width=768&dpr=4&quality=100&sign=9e92d041&sv=1)
![](https://amartyushov.gitbook.io/~gitbook/image?url=https%3A%2F%2F415484505-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-LxtoAXZwwOc4XGto8vb%252Fuploads%252FafYkwLyOdldQewFS2pez%252FScreenshot%25202022-08-30%2520at%252009.12.21.png%3Falt%3Dmedia%26token%3Db7c7f5e8-2191-4db8-91aa-f528d3263a49&width=768&dpr=4&quality=100&sign=41e0bda&sv=1)
![](https://amartyushov.gitbook.io/~gitbook/image?url=https%3A%2F%2F415484505-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-LxtoAXZwwOc4XGto8vb%252Fuploads%252FEXB8mNcv3f8Z6dyOrRJd%252FScreenshot%25202022-08-30%2520at%252009.14.09.png%3Falt%3Dmedia%26token%3D16631575-a276-4c59-b977-70614744a9cc&width=768&dpr=4&quality=100&sign=bb8d85e3&sv=1)
Last updated