mjiderhamn/classloader-leak-prevention

Remove debug logging from the default output

Closed this issue · 0 comments

vlsi commented

Currently the ClassLoader produces a lot of noise to System.out :-/
Would you please suppress that?

See an example at https://github.com/pgjdbc/pgjdbc/actions/runs/4392951692/jobs/7693035071#step:8:534

    Loading org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest$LeakPreventor in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    JUnit used sun.misc.Launcher$AppClassLoader@73d16e93
    SeparateClassLoaderInvokeMethod used se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.Driver in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.util.PSQLException in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.util.SharedTimer in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.util.LazyCleaner$CleaningAction in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.jdbc.ResourceLock in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.test.TestUtil in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.core.Version in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.PGProperty in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.jdbc.GSSEncMode in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.Driver$1 in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.util.URLCoder in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.util.PGPropertyUtil in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.core.v3.replication.V3ReplicationProtocol in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.replication.fluent.CommonOptions in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.replication.PGReplicationStream in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.core.AsciiStringInterner$TempKey in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.jdbc.TimestampUtils in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.core.JavaVersion in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.hostchooser.GlobalHostStatusTracker in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.hostchooser.GlobalHostStatusTracker$HostSpecStatus in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.core.Utils in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.core.SetupQueryRunner in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.core.SetupQueryRunner$SimpleResultHandler in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.core.ResultHandlerBase in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.core.v3.QueryExecutorImpl$4 in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.core.v3.ExecuteRequest in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.jdbc.QueryExecutorTimeZoneProvider in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.jdbc.TypeInfoCache in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.geometric.PGbox in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.util.PGBinaryObject in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.util.PGobject in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.geometric.PGcircle in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.geometric.PGline in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.geometric.PGlseg in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.geometric.PGpath in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.geometric.PGpoint in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.geometric.PGpolygon in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.util.PGmoney in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.util.PGInterval in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.jdbc.PgConnectionCleaningAction in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.util.LazyCleaner in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.util.LazyCleaner$Cleanable in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.util.LazyCleaner$Node in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
    Loading org.postgresql.util.LazyCleaner$1 in se.jiderhamn.classloader.RedefiningClassLoader[org.postgresql.test.jdbc4.jdbc41.DriverSupportsClassUnloadingTest.driverUnloadsWhenConnectionLeaks]@75f2099
....