db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DERBY-5316) Unload old JDBC drivers when done with them in the upgrade tests
Date Fri, 08 Jul 2011 12:16:18 GMT

     [ https://issues.apache.org/jira/browse/DERBY-5316?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Knut Anders Hatlen updated DERBY-5316:
--------------------------------------

    Attachment: deregister.diff

I wrote this patch to run DriverManager.deregisterDriver() in the class loader that had loaded
the driver. By instrumenting DriverManager, I've verified that the old drivers get deregistered
when we're done with them. However, I still need to increase permgen from the default (64M)
to get the upgrade tests to complete without OOME.

Using the JVM flags Kristian mentioned, I see this trace:

$ grep EmbeddedDriver out.txt
[Loaded org.apache.derby.jdbc.EmbeddedDriver from file:/code/derby/oldreleases/10.0.2.1/derby.jar]
[Loaded org.apache.derby.jdbc.EmbeddedDriver from file:/code/derby/trunk/jars/sane/derby.jar]
[Loaded org.apache.derby.jdbc.EmbeddedDriver from file:/code/derby/oldreleases/10.1.1.0/derby.jar]
[Loaded org.apache.derby.jdbc.EmbeddedDriver from file:/code/derby/oldreleases/10.1.2.1/derby.jar]
[Loaded org.apache.derby.jdbc.EmbeddedDriver from file:/code/derby/oldreleases/10.1.3.1/derby.jar]
[Loaded org.apache.derby.jdbc.EmbeddedDriver from file:/code/derby/oldreleases/10.2.1.6/derby.jar]
[Loaded org.apache.derby.jdbc.EmbeddedDriver from file:/code/derby/oldreleases/10.2.2.0/derby.jar]
[Unloading class org.apache.derby.jdbc.EmbeddedDriver]
[Loaded org.apache.derby.jdbc.EmbeddedDriver from file:/code/derby/oldreleases/10.3.1.4/derby.jar]
[Unloading class org.apache.derby.jdbc.EmbeddedDriver]
[Loaded org.apache.derby.jdbc.EmbeddedDriver from file:/code/derby/oldreleases/10.3.3.0/derby.jar]
[Unloading class org.apache.derby.jdbc.EmbeddedDriver]
[Loaded org.apache.derby.jdbc.EmbeddedDriver from file:/code/derby/oldreleases/10.4.1.3/derby.jar]
[Unloading class org.apache.derby.jdbc.EmbeddedDriver]
[Loaded org.apache.derby.jdbc.EmbeddedDriver from file:/code/derby/oldreleases/10.4.2.0/derby.jar]
[Unloading class org.apache.derby.jdbc.EmbeddedDriver]
[Loaded org.apache.derby.jdbc.EmbeddedDriver from file:/code/derby/oldreleases/10.5.1.1/derby.jar]
[Unloading class org.apache.derby.jdbc.EmbeddedDriver]
[Loaded org.apache.derby.jdbc.EmbeddedDriver from file:/code/derby/oldreleases/10.5.3.0/derby.jar]
[Loaded org.apache.derby.jdbc.EmbeddedDriver from file:/code/derby/oldreleases/10.6.1.0/derby.jar]
[Loaded org.apache.derby.jdbc.EmbeddedDriver from file:/code/derby/oldreleases/10.6.2.1/derby.jar]
[Loaded org.apache.derby.jdbc.EmbeddedDriver from file:/code/derby/oldreleases/10.7.1.1/derby.jar]
[Loaded org.apache.derby.jdbc.EmbeddedDriver from file:/code/derby/oldreleases/10.8.1.2/derby.jar]
[Unloading class org.apache.derby.jdbc.EmbeddedDriver]

Since it doesn't specify exactly which variant of the class that is unloaded, I'd have to
guess, but it looks to me as if 10.0.x and 10.1.x don't get unloaded. 10.2.x, 10.3.x and 10.4.x
do get unloaded. Then 10.5.x and 10.6.x don't get unloaded. Finally 10.7.1.1 is unloaded,
whereas 10.8.1.2 isn't unloaded because the test completes so soon after the deregistration
of the driver that the JVM doesn't have time to do a gc.

> Unload old JDBC drivers when done with them in the upgrade tests
> ----------------------------------------------------------------
>
>                 Key: DERBY-5316
>                 URL: https://issues.apache.org/jira/browse/DERBY-5316
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>            Reporter: Knut Anders Hatlen
>         Attachments: deregister.diff
>
>
> Discussed in this thread on derby-dev: http://mail-archives.apache.org/mod_mbox/db-derby-dev/201107.mbox/%3C4E146309.3000906@gmail.com%3E
> After we're done testing an old version in the upgrade tests, its classes are still loaded
in the JVM because the old driver is referenced in DriverManager. We should find a way to
unload the old drivers so that the memory usage of the upgrade tests is reduced. Now we typically
need to run with -XX:MaxPermSize=200M or similar options to work around this issue.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message