You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

load heapdump in eclipse MAT
create histogram
group classes by classloader
among others we can see several ChildFirstClassLoader objects
these are the user classloaders
because they are still around, something is leaking it
select one of these entries, and merge the shortest paths to GC roots
there is now one entry for the system classloader
drilling down into it we find the java.sql.DriverManager
the contained registeredDrivers array contains multiple drivers for druid, postgresql and calcite
select any of these drivers, use Java Basics -> Class Loader explorer
you are now shown a ChildFirstClassLoader

This means that the driver originates from the user classloader, but is referenced from the system classloader. If the reference in the latter is not removed (due to improper cleanup), then the user classloader cannot be garbage collected.

  • No labels