While using visualVM to detect memory leak, it allows us an Instance view as described below:
The Instance view displays object instances for a selected class. When you select an instance from the Instance pane, VisualVM displays the fields of that class and references to that class in the respective panes. In the References pane, you can right-click an item and choose Show Nearest GC Root to display the nearest garbage collection root object.
Can anybody tell me what the nearest garbage collection root object is and how to make use of this information to help identify the leaking spots. Thanks!
You might find this Sun book/chapter on Garbage Collection useful, in particular this section which lists GC root as:
In other words, GC roots are variables that can keep another object from being GCed by virtue of the root holding a reference to it.