Experienced / Expert level questions
Experienced / Expert level questions & answers
Ques 1. What is the PermGen space, and is it still used in Java 8 and later?
PermGen (Permanent Generation) space was used to store metadata related to classes. In Java 8 and later, PermGen space is replaced by Metaspace, which is more flexible and avoids memory leaks related to class metadata.
Ques 2. Explain the concept of garbage collection tuning in Java.
Garbage collection tuning involves configuring the garbage collector to meet specific performance goals. It includes selecting the appropriate garbage collector algorithm and adjusting related parameters.
Ques 3. Explain the concept of garbage collection pause times.
Garbage collection pause times refer to the periods during which application threads are stopped while the garbage collector performs its tasks. Minimizing pause times is essential for maintaining application responsiveness.
Ques 4. Explain the concept of the 'garbage-first' (G1) garbage collector.
The G1 garbage collector is designed to provide high throughput and low-latency garbage collection. It divides the heap into regions and uses a series of Garbage-First (GF) queues to prioritize collection of regions with the most garbage.
Ques 5. How does the Java Virtual Machine (JVM) handle circular references in garbage collection?
The JVM uses a reachability analysis to determine if objects are reachable or not. Circular references are handled by the garbage collector, which identifies and collects objects that are no longer reachable.
Ques 6. What is the 'Reference' class in Java, and how is it used in garbage collection?
The 'Reference' class is part of the java.lang.ref package and provides a way to create and manipulate references to objects. It is often used in advanced memory management scenarios and garbage collection.
Ques 7. Explain the concept of 'GC overhead limit exceeded' error in Java.
The 'GC overhead limit exceeded' error occurs when the JVM spends too much time on garbage collection, exceeding a specified threshold (98% by default) of the total time. It indicates a potential performance issue.
Ques 8. Explain the concept of 'Card Table' in the context of the G1 garbage collector.
The 'Card Table' is a data structure used by the G1 garbage collector to track changes in the heap. It allows the collector to efficiently identify and collect only the regions of the heap containing modified objects.
Ques 9. What is the 'CMSConcurrentAbortablePreclean' phase in the CMS garbage collector?
The 'CMSConcurrentAbortablePreclean' is a phase in the CMS (Concurrent Mark-Sweep) garbage collector that performs additional work on the Old Generation to prepare for the final mark phase. It is concurrent and aims to minimize pause times.
Ques 10. Explain the concept of 'Shenandoah' garbage collector in Java.
Shenandoah is a low-pause-time garbage collector introduced in Java. It uses advanced techniques to perform garbage collection concurrently with application threads, minimizing pause times and improving overall responsiveness.
Most helpful rated by users: