This Garbage Collection interview question is recently asked by one of my friends. It requires more than average knowledge on GC to answer this question.
By the way, ParNew and DefNew are two young generation garbage collector. ParNew is a multi-threaded GC used along with concurrent Mark Sweep while DefNew is a single-threaded GC used along with Serial Garbage Collector.
How do you find GC resulted due to calling System.gc()?
Answer: Another GC interview question is based on GC output. Similar to the major and minor collection, there will be the word “System” included in the Garbage collection output.