- Java 10 - Discussion
- Java 10 - Useful Resources
- Java 10 - Quick Guide
- Java 9 Tutorial
- Java 8 Tutorial
- Java Tutorial
- Java 10 - Thread-local Handshake
- Java 10 - Root Certificate
- Java 10 - Consolidated JDK Forest
- Java 10 - Heap Allocation
- Java 10 - Locale Enhancement
- Java 10 - Enhanced Garbage Collection
- Java 10 - Class-Data Sharing
- Java 10 - JIT Compiler
- Java 10 - Deprecated Features & Options
- Java 10 - Removed Features & Options
- Java 10 - New APIs & Options
- Java 10 - Local Variable Type Inference
- Java 10 - Time Based Release Versioning
- Java 10 - Environment Setup
- Java 10 - Overview
- Java 10 - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Java 10 - Enhanced Garbage Collection
JEP 304 - Garbage-Collector Interface
Before Java 10, GC (Garbage Collector) implementation components were scattered within code base and were not replaceable easily. With Java 10, Garbage-Collector interface is introduced so that alternative GC implementations can be plugged in. It also helps in isolating the code base from different garbage collection implementations. This feature is part of JEP 304.
JEP 307 - Parallel Full GC for G1
Java 9 introduced G1 (Garbage First) garbage collector. G1 avoids full garbage collection but in case of concurrent threads look for collection and memory is not revived fast enough, user experience is impacted. With Java 10, now G1 will use a fall back Full Garbage Collection.
With this change, G1 improves its worst-case latency by using a Full GC in parallel. At present, G1 uses a single threaded mark-sweep-compact algorithm. With JEP 307, a parallel thread will start mark-sweep-compact algorithm. Number of threads can be controlled using following option.
$java -XX:ParallelGCThreads=4Advertisements