You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by "Kevan Miller (JIRA)" <de...@geronimo.apache.org> on 2005/11/15 19:07:27 UTC

[jira] Created: (GERONIMO-1177) URLJarFile memory leak

URLJarFile memory leak
----------------------

         Key: GERONIMO-1177
         URL: http://issues.apache.org/jira/browse/GERONIMO-1177
     Project: Geronimo
        Type: Bug
  Components: common  
    Versions: 1.0-M5    
 Environment: Win XP/ JDK 1.4.2
    Reporter: Kevan Miller
     Fix For: 1.0


There is a Sun bug which is causing a memory leak of URLJarFile instances in Geronimo. The problem is caused by http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4167874 -- sun.net.www.protocol.jar.JarFileFactory will hold onto strong references to all URLJarFile instances. So URLJarFiles can never be GCed. This means that for every deploy/undeploy of an application, you'll leak URLJarFiles.

The problem can be avoided by calling URLConnection.setDefaultUseCaches(false); This will turn off the caching in JarFileFactory. 

I have a fix which adds a GeronimoEnvironment class that can be used to perform common environment setup for server, client, and deployer processes. GeronimoEnvironment.init(); is invoked as appropriate from these three process environments. init() currently only sets DefaultUseCaches to false. There may be other functions which we could move there, but I didn't investigate too deeply...

Note that setDefaultUseCaches(false) is a "global" setting. So it affects the entire runtime. URLConnection.setUseCaches(false) does not fix the problem.

I'll post my patch, shortly...



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (GERONIMO-1177) URLJarFile memory leak

Posted by "Kevan Miller (JIRA)" <de...@geronimo.apache.org>.
     [ http://issues.apache.org/jira/browse/GERONIMO-1177?page=all ]

Kevan Miller updated GERONIMO-1177:
-----------------------------------

    Attachment: urljarfile.patch

Promised patch... 

> URLJarFile memory leak
> ----------------------
>
>          Key: GERONIMO-1177
>          URL: http://issues.apache.org/jira/browse/GERONIMO-1177
>      Project: Geronimo
>         Type: Bug
>   Components: common
>     Versions: 1.0-M5
>  Environment: Win XP/ JDK 1.4.2
>     Reporter: Kevan Miller
>      Fix For: 1.0
>  Attachments: urljarfile.patch
>
> There is a Sun bug which is causing a memory leak of URLJarFile instances in Geronimo. The problem is caused by http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4167874 -- sun.net.www.protocol.jar.JarFileFactory will hold onto strong references to all URLJarFile instances. So URLJarFiles can never be GCed. This means that for every deploy/undeploy of an application, you'll leak URLJarFiles.
> The problem can be avoided by calling URLConnection.setDefaultUseCaches(false); This will turn off the caching in JarFileFactory. 
> I have a fix which adds a GeronimoEnvironment class that can be used to perform common environment setup for server, client, and deployer processes. GeronimoEnvironment.init(); is invoked as appropriate from these three process environments. init() currently only sets DefaultUseCaches to false. There may be other functions which we could move there, but I didn't investigate too deeply...
> Note that setDefaultUseCaches(false) is a "global" setting. So it affects the entire runtime. URLConnection.setUseCaches(false) does not fix the problem.
> I'll post my patch, shortly...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (GERONIMO-1177) URLJarFile memory leak

Posted by "Kevan Miller (JIRA)" <de...@geronimo.apache.org>.
     [ http://issues.apache.org/jira/browse/GERONIMO-1177?page=all ]

Kevan Miller updated GERONIMO-1177:
-----------------------------------

    Geronimo Info: [Patch Available]

> URLJarFile memory leak
> ----------------------
>
>          Key: GERONIMO-1177
>          URL: http://issues.apache.org/jira/browse/GERONIMO-1177
>      Project: Geronimo
>         Type: Bug
>   Components: common
>     Versions: 1.0-M5
>  Environment: Win XP/ JDK 1.4.2
>     Reporter: Kevan Miller
>      Fix For: 1.0
>  Attachments: urljarfile.patch
>
> There is a Sun bug which is causing a memory leak of URLJarFile instances in Geronimo. The problem is caused by http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4167874 -- sun.net.www.protocol.jar.JarFileFactory will hold onto strong references to all URLJarFile instances. So URLJarFiles can never be GCed. This means that for every deploy/undeploy of an application, you'll leak URLJarFiles.
> The problem can be avoided by calling URLConnection.setDefaultUseCaches(false); This will turn off the caching in JarFileFactory. 
> I have a fix which adds a GeronimoEnvironment class that can be used to perform common environment setup for server, client, and deployer processes. GeronimoEnvironment.init(); is invoked as appropriate from these three process environments. init() currently only sets DefaultUseCaches to false. There may be other functions which we could move there, but I didn't investigate too deeply...
> Note that setDefaultUseCaches(false) is a "global" setting. So it affects the entire runtime. URLConnection.setUseCaches(false) does not fix the problem.
> I'll post my patch, shortly...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Assigned: (GERONIMO-1177) URLJarFile memory leak

Posted by "Jeff Genender (JIRA)" <de...@geronimo.apache.org>.
     [ http://issues.apache.org/jira/browse/GERONIMO-1177?page=all ]

Jeff Genender reassigned GERONIMO-1177:
---------------------------------------

    Assign To: Jeff Genender

> URLJarFile memory leak
> ----------------------
>
>          Key: GERONIMO-1177
>          URL: http://issues.apache.org/jira/browse/GERONIMO-1177
>      Project: Geronimo
>         Type: Bug
>   Components: common
>     Versions: 1.0-M5
>  Environment: Win XP/ JDK 1.4.2
>     Reporter: Kevan Miller
>     Assignee: Jeff Genender
>      Fix For: 1.0
>  Attachments: urljarfile.patch
>
> There is a Sun bug which is causing a memory leak of URLJarFile instances in Geronimo. The problem is caused by http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4167874 -- sun.net.www.protocol.jar.JarFileFactory will hold onto strong references to all URLJarFile instances. So URLJarFiles can never be GCed. This means that for every deploy/undeploy of an application, you'll leak URLJarFiles.
> The problem can be avoided by calling URLConnection.setDefaultUseCaches(false); This will turn off the caching in JarFileFactory. 
> I have a fix which adds a GeronimoEnvironment class that can be used to perform common environment setup for server, client, and deployer processes. GeronimoEnvironment.init(); is invoked as appropriate from these three process environments. init() currently only sets DefaultUseCaches to false. There may be other functions which we could move there, but I didn't investigate too deeply...
> Note that setDefaultUseCaches(false) is a "global" setting. So it affects the entire runtime. URLConnection.setUseCaches(false) does not fix the problem.
> I'll post my patch, shortly...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (GERONIMO-1177) URLJarFile memory leak

Posted by "Kevan Miller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-1177?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kevan Miller closed GERONIMO-1177.
----------------------------------


> URLJarFile memory leak
> ----------------------
>
>                 Key: GERONIMO-1177
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-1177
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: common
>    Affects Versions: 1.0-M5
>         Environment: Win XP/ JDK 1.4.2
>            Reporter: Kevan Miller
>            Assignee: Jeff Genender
>             Fix For: 1.0
>
>         Attachments: urljarfile.patch
>
>
> There is a Sun bug which is causing a memory leak of URLJarFile instances in Geronimo. The problem is caused by http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4167874 -- sun.net.www.protocol.jar.JarFileFactory will hold onto strong references to all URLJarFile instances. So URLJarFiles can never be GCed. This means that for every deploy/undeploy of an application, you'll leak URLJarFiles.
> The problem can be avoided by calling URLConnection.setDefaultUseCaches(false); This will turn off the caching in JarFileFactory. 
> I have a fix which adds a GeronimoEnvironment class that can be used to perform common environment setup for server, client, and deployer processes. GeronimoEnvironment.init(); is invoked as appropriate from these three process environments. init() currently only sets DefaultUseCaches to false. There may be other functions which we could move there, but I didn't investigate too deeply...
> Note that setDefaultUseCaches(false) is a "global" setting. So it affects the entire runtime. URLConnection.setUseCaches(false) does not fix the problem.
> I'll post my patch, shortly...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (GERONIMO-1177) URLJarFile memory leak

Posted by "David Jencks (JIRA)" <de...@geronimo.apache.org>.
    [ http://issues.apache.org/jira/browse/GERONIMO-1177?page=comments#action_12357726 ] 

David Jencks commented on GERONIMO-1177:
----------------------------------------

Jeff, you missed the new files
Adding         modules/common/src/java/org/apache/geronimo/common/GeronimoEnvironment.java
Adding         modules/common/src/test/org/apache/geronimo/common/GeronimoEnvironmentTest.java
Transmitting file data ..
Committed revision 344443.

> URLJarFile memory leak
> ----------------------
>
>          Key: GERONIMO-1177
>          URL: http://issues.apache.org/jira/browse/GERONIMO-1177
>      Project: Geronimo
>         Type: Bug
>   Components: common
>     Versions: 1.0-M5
>  Environment: Win XP/ JDK 1.4.2
>     Reporter: Kevan Miller
>     Assignee: Jeff Genender
>      Fix For: 1.0
>  Attachments: urljarfile.patch
>
> There is a Sun bug which is causing a memory leak of URLJarFile instances in Geronimo. The problem is caused by http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4167874 -- sun.net.www.protocol.jar.JarFileFactory will hold onto strong references to all URLJarFile instances. So URLJarFiles can never be GCed. This means that for every deploy/undeploy of an application, you'll leak URLJarFiles.
> The problem can be avoided by calling URLConnection.setDefaultUseCaches(false); This will turn off the caching in JarFileFactory. 
> I have a fix which adds a GeronimoEnvironment class that can be used to perform common environment setup for server, client, and deployer processes. GeronimoEnvironment.init(); is invoked as appropriate from these three process environments. init() currently only sets DefaultUseCaches to false. There may be other functions which we could move there, but I didn't investigate too deeply...
> Note that setDefaultUseCaches(false) is a "global" setting. So it affects the entire runtime. URLConnection.setUseCaches(false) does not fix the problem.
> I'll post my patch, shortly...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (GERONIMO-1177) URLJarFile memory leak

Posted by "Jeff Genender (JIRA)" <de...@geronimo.apache.org>.
     [ http://issues.apache.org/jira/browse/GERONIMO-1177?page=all ]
     
Jeff Genender resolved GERONIMO-1177:
-------------------------------------

    Resolution: Fixed

Great find and great work, Kevan...

Sending        modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/DeployTool.java
Sending        modules/system/src/java/org/apache/geronimo/system/main/CommandLine.java
Sending        modules/system/src/java/org/apache/geronimo/system/main/Daemon.java
Transmitting file data ...
Committed revision 344419.


> URLJarFile memory leak
> ----------------------
>
>          Key: GERONIMO-1177
>          URL: http://issues.apache.org/jira/browse/GERONIMO-1177
>      Project: Geronimo
>         Type: Bug
>   Components: common
>     Versions: 1.0-M5
>  Environment: Win XP/ JDK 1.4.2
>     Reporter: Kevan Miller
>     Assignee: Jeff Genender
>      Fix For: 1.0
>  Attachments: urljarfile.patch
>
> There is a Sun bug which is causing a memory leak of URLJarFile instances in Geronimo. The problem is caused by http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4167874 -- sun.net.www.protocol.jar.JarFileFactory will hold onto strong references to all URLJarFile instances. So URLJarFiles can never be GCed. This means that for every deploy/undeploy of an application, you'll leak URLJarFiles.
> The problem can be avoided by calling URLConnection.setDefaultUseCaches(false); This will turn off the caching in JarFileFactory. 
> I have a fix which adds a GeronimoEnvironment class that can be used to perform common environment setup for server, client, and deployer processes. GeronimoEnvironment.init(); is invoked as appropriate from these three process environments. init() currently only sets DefaultUseCaches to false. There may be other functions which we could move there, but I didn't investigate too deeply...
> Note that setDefaultUseCaches(false) is a "global" setting. So it affects the entire runtime. URLConnection.setUseCaches(false) does not fix the problem.
> I'll post my patch, shortly...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira