You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Roman Puchkovskiy (JIRA)" <ji...@apache.org> on 2008/07/02 15:23:45 UTC

[jira] Created: (JCR-1668) After RepositoryImpl instance has been created and shut down, some classes cannot be unloaded

After RepositoryImpl instance has been created and shut down, some classes cannot be unloaded
---------------------------------------------------------------------------------------------

                 Key: JCR-1668
                 URL: https://issues.apache.org/jira/browse/JCR-1668
             Project: Jackrabbit
          Issue Type: Bug
          Components: jackrabbit-core, jackrabbit-jcr-commons
    Affects Versions: commons 1.4.2, 1.4, core 1.4.5
         Environment: windows vista
java version "1.6.0_06"
Jetty 6.1.9
Apache Tomcat 6.0.14
            Reporter: Roman Puchkovskiy
         Attachments: test-undeploy.zip

I've built a simple web-application, which contains one servlet loaded at start-up. In its init() method an instance of RepositoryImpl() is created, in its destroy() method this instance is stopped (using shutdown()).
>From the servlet code, only classes in jackrabbit-core, JCR API and Servlet API are referenced.
jackrabbit-core version is 1.4.5, and jackrabbit-jcr-commons version is 1.4.2. Other jackrabbit libs are all of 1.4 version.

Even if servlet's doGet() method never gets called, when the web-application is redeployed, all its classes still hang in memory, which produces a memory leak.

init() method is 

    public void init() throws ServletException {
        super.init();
        try {
            RepositoryConfig repoConfig = RepositoryConfig.create(getClass().getResourceAsStream("repository.xml"), ".");
            repo = RepositoryImpl.create(repoConfig);
        } catch (Exception e) {
            throw new ServletException(e);
        }
    }

while destroy() method is

    public void destroy() {
        repo.shutdown();
        super.destroy();
    }

Even when I applied patches from JCR-1636 and added TransientFileFactory.shutdown() call to destroy() method, nothing has changed.
Tested this in Jetty 6.1.9 and Tomcat 6.0.14.

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


[jira] Commented: (JCR-1668) After RepositoryImpl instance has been created and shut down, some classes cannot be unloaded

Posted by "Martijn Hendriks (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12731907#action_12731907 ] 

Martijn Hendriks commented on JCR-1668:
---------------------------------------

There's yet another background thread that gives a memory leak in environments where the jackrabbit libraries can be dynamically updated (OSGi, webapps, ...): the revision table janitor in the DatabaseJournal class. This thread must be stopped when the "stop" method of the journal is called.

W.r.t. the TransientFileFactory: can't we automate the call to shutdown? If RepositoryImpl.create registers the just created instance at the TransientFileFactory and RepositoryImpl.doShutdown de-registers the current instance, then TransientFileFactory can keep a reference count and call shutDown itself when the reference count is 0.

> After RepositoryImpl instance has been created and shut down, some classes cannot be unloaded
> ---------------------------------------------------------------------------------------------
>
>                 Key: JCR-1668
>                 URL: https://issues.apache.org/jira/browse/JCR-1668
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core, jackrabbit-jcr-commons
>    Affects Versions: 1.4, commons 1.4.2, core 1.4.5
>         Environment: windows vista
> java version "1.6.0_06"
> Jetty 6.1.9
> Apache Tomcat 6.0.14
>            Reporter: Roman Puchkovskiy
>         Attachments: JCR-1636-reaper-thread.patch, test-undeploy-v2.zip
>
>
> I've built a simple web-application, which contains one servlet loaded at start-up. In its init() method an instance of RepositoryImpl() is created, in its destroy() method this instance is stopped (using shutdown()).
> From the servlet code, only classes in jackrabbit-core, JCR API and Servlet API are referenced.
> jackrabbit-core version is 1.4.5, and jackrabbit-jcr-commons version is 1.4.2. Other jackrabbit libs are all of 1.4 version.
> Even if servlet's doGet() method never gets called, when the web-application is redeployed, all its classes still hang in memory, which produces a memory leak.
> init() method is 
>     public void init() throws ServletException {
>         super.init();
>         try {
>             RepositoryConfig repoConfig = RepositoryConfig.create(getClass().getResourceAsStream("repository.xml"), ".");
>             repo = RepositoryImpl.create(repoConfig);
>         } catch (Exception e) {
>             throw new ServletException(e);
>         }
>     }
> while destroy() method is
>     public void destroy() {
>         repo.shutdown();
>         super.destroy();
>     }
> Even when I applied patches from JCR-1636 and added TransientFileFactory.shutdown() call to destroy() method, nothing has changed.
> Tested this in Jetty 6.1.9 and Tomcat 6.0.14.

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


[jira] Updated: (JCR-1668) After RepositoryImpl instance has been created and shut down, some classes cannot be unloaded

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

Roman Puchkovskiy updated JCR-1668:
-----------------------------------

    Attachment:     (was: test-undeploy.zip)

> After RepositoryImpl instance has been created and shut down, some classes cannot be unloaded
> ---------------------------------------------------------------------------------------------
>
>                 Key: JCR-1668
>                 URL: https://issues.apache.org/jira/browse/JCR-1668
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core, jackrabbit-jcr-commons
>    Affects Versions: 1.4, commons 1.4.2, core 1.4.5
>         Environment: windows vista
> java version "1.6.0_06"
> Jetty 6.1.9
> Apache Tomcat 6.0.14
>            Reporter: Roman Puchkovskiy
>         Attachments: JCR-1636-reaper-thread.patch, test-undeploy-v2.zip
>
>
> I've built a simple web-application, which contains one servlet loaded at start-up. In its init() method an instance of RepositoryImpl() is created, in its destroy() method this instance is stopped (using shutdown()).
> From the servlet code, only classes in jackrabbit-core, JCR API and Servlet API are referenced.
> jackrabbit-core version is 1.4.5, and jackrabbit-jcr-commons version is 1.4.2. Other jackrabbit libs are all of 1.4 version.
> Even if servlet's doGet() method never gets called, when the web-application is redeployed, all its classes still hang in memory, which produces a memory leak.
> init() method is 
>     public void init() throws ServletException {
>         super.init();
>         try {
>             RepositoryConfig repoConfig = RepositoryConfig.create(getClass().getResourceAsStream("repository.xml"), ".");
>             repo = RepositoryImpl.create(repoConfig);
>         } catch (Exception e) {
>             throw new ServletException(e);
>         }
>     }
> while destroy() method is
>     public void destroy() {
>         repo.shutdown();
>         super.destroy();
>     }
> Even when I applied patches from JCR-1636 and added TransientFileFactory.shutdown() call to destroy() method, nothing has changed.
> Tested this in Jetty 6.1.9 and Tomcat 6.0.14.

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


[jira] Issue Comment Edited: (JCR-1668) After RepositoryImpl instance has been created and shut down, some classes cannot be unloaded

Posted by "Martijn Hendriks (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12731907#action_12731907 ] 

Martijn Hendriks edited comment on JCR-1668 at 7/16/09 7:08 AM:
----------------------------------------------------------------

There's yet another background thread that gives a memory leak in environments where the jackrabbit libraries can be dynamically updated (OSGi, webapps, ...): the revision table janitor in the DatabaseJournal class. This thread must be stopped when the "stop" method of the journal is called.

W.r.t. the TransientFileFactory: can't we automate the call to shutdown? If RepositoryImpl.create registers the just created instance at the TransientFileFactory and RepositoryImpl.doShutdown de-registers the current instance, then TransientFileFactory can keep a reference count and call shutDown itself when the reference count is 0. Mmm...that will not work if the TransientFileFactory is used outside the scope of an active repository instance and that could very well be the case judging from the classes that use it...

      was (Author: martijnh):
    There's yet another background thread that gives a memory leak in environments where the jackrabbit libraries can be dynamically updated (OSGi, webapps, ...): the revision table janitor in the DatabaseJournal class. This thread must be stopped when the "stop" method of the journal is called.

W.r.t. the TransientFileFactory: can't we automate the call to shutdown? If RepositoryImpl.create registers the just created instance at the TransientFileFactory and RepositoryImpl.doShutdown de-registers the current instance, then TransientFileFactory can keep a reference count and call shutDown itself when the reference count is 0.
  
> After RepositoryImpl instance has been created and shut down, some classes cannot be unloaded
> ---------------------------------------------------------------------------------------------
>
>                 Key: JCR-1668
>                 URL: https://issues.apache.org/jira/browse/JCR-1668
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core, jackrabbit-jcr-commons
>    Affects Versions: 1.4, commons 1.4.2, core 1.4.5
>         Environment: windows vista
> java version "1.6.0_06"
> Jetty 6.1.9
> Apache Tomcat 6.0.14
>            Reporter: Roman Puchkovskiy
>         Attachments: JCR-1636-reaper-thread.patch, test-undeploy-v2.zip
>
>
> I've built a simple web-application, which contains one servlet loaded at start-up. In its init() method an instance of RepositoryImpl() is created, in its destroy() method this instance is stopped (using shutdown()).
> From the servlet code, only classes in jackrabbit-core, JCR API and Servlet API are referenced.
> jackrabbit-core version is 1.4.5, and jackrabbit-jcr-commons version is 1.4.2. Other jackrabbit libs are all of 1.4 version.
> Even if servlet's doGet() method never gets called, when the web-application is redeployed, all its classes still hang in memory, which produces a memory leak.
> init() method is 
>     public void init() throws ServletException {
>         super.init();
>         try {
>             RepositoryConfig repoConfig = RepositoryConfig.create(getClass().getResourceAsStream("repository.xml"), ".");
>             repo = RepositoryImpl.create(repoConfig);
>         } catch (Exception e) {
>             throw new ServletException(e);
>         }
>     }
> while destroy() method is
>     public void destroy() {
>         repo.shutdown();
>         super.destroy();
>     }
> Even when I applied patches from JCR-1636 and added TransientFileFactory.shutdown() call to destroy() method, nothing has changed.
> Tested this in Jetty 6.1.9 and Tomcat 6.0.14.

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


[jira] Updated: (JCR-1668) After RepositoryImpl instance has been created and shut down, some classes cannot be unloaded

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

Martijn Hendriks updated JCR-1668:
----------------------------------

    Attachment: JCR-1636.patch

Here's a patch based on Roman's patch. It additionally avoids raw types, makes some fields final, and makes the "stopping" field volatile. It also contains the code to properly stop the revision table janitor.

> After RepositoryImpl instance has been created and shut down, some classes cannot be unloaded
> ---------------------------------------------------------------------------------------------
>
>                 Key: JCR-1668
>                 URL: https://issues.apache.org/jira/browse/JCR-1668
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core, jackrabbit-jcr-commons
>    Affects Versions: 1.4, commons 1.4.2, core 1.4.5
>         Environment: windows vista
> java version "1.6.0_06"
> Jetty 6.1.9
> Apache Tomcat 6.0.14
>            Reporter: Roman Puchkovskiy
>         Attachments: JCR-1636-reaper-thread.patch, JCR-1636.patch, test-undeploy-v2.zip
>
>
> I've built a simple web-application, which contains one servlet loaded at start-up. In its init() method an instance of RepositoryImpl() is created, in its destroy() method this instance is stopped (using shutdown()).
> From the servlet code, only classes in jackrabbit-core, JCR API and Servlet API are referenced.
> jackrabbit-core version is 1.4.5, and jackrabbit-jcr-commons version is 1.4.2. Other jackrabbit libs are all of 1.4 version.
> Even if servlet's doGet() method never gets called, when the web-application is redeployed, all its classes still hang in memory, which produces a memory leak.
> init() method is 
>     public void init() throws ServletException {
>         super.init();
>         try {
>             RepositoryConfig repoConfig = RepositoryConfig.create(getClass().getResourceAsStream("repository.xml"), ".");
>             repo = RepositoryImpl.create(repoConfig);
>         } catch (Exception e) {
>             throw new ServletException(e);
>         }
>     }
> while destroy() method is
>     public void destroy() {
>         repo.shutdown();
>         super.destroy();
>     }
> Even when I applied patches from JCR-1636 and added TransientFileFactory.shutdown() call to destroy() method, nothing has changed.
> Tested this in Jetty 6.1.9 and Tomcat 6.0.14.

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


[jira] Updated: (JCR-1668) After RepositoryImpl instance has been created and shut down, some classes cannot be unloaded

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

Jukka Zitting updated JCR-1668:
-------------------------------

    Fix Version/s:     (was: 2.0.0)
                   1.6.0

Merged to the 1.x branch in revision 801136.

> After RepositoryImpl instance has been created and shut down, some classes cannot be unloaded
> ---------------------------------------------------------------------------------------------
>
>                 Key: JCR-1668
>                 URL: https://issues.apache.org/jira/browse/JCR-1668
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core, jackrabbit-jcr-commons
>    Affects Versions: 1.4, commons 1.4.2, core 1.4.5
>         Environment: windows vista
> java version "1.6.0_06"
> Jetty 6.1.9
> Apache Tomcat 6.0.14
>            Reporter: Roman Puchkovskiy
>             Fix For: 1.6.0
>
>         Attachments: JCR-1636-reaper-thread.patch, JCR-1636.patch, test-undeploy-v2.zip
>
>
> I've built a simple web-application, which contains one servlet loaded at start-up. In its init() method an instance of RepositoryImpl() is created, in its destroy() method this instance is stopped (using shutdown()).
> From the servlet code, only classes in jackrabbit-core, JCR API and Servlet API are referenced.
> jackrabbit-core version is 1.4.5, and jackrabbit-jcr-commons version is 1.4.2. Other jackrabbit libs are all of 1.4 version.
> Even if servlet's doGet() method never gets called, when the web-application is redeployed, all its classes still hang in memory, which produces a memory leak.
> init() method is 
>     public void init() throws ServletException {
>         super.init();
>         try {
>             RepositoryConfig repoConfig = RepositoryConfig.create(getClass().getResourceAsStream("repository.xml"), ".");
>             repo = RepositoryImpl.create(repoConfig);
>         } catch (Exception e) {
>             throw new ServletException(e);
>         }
>     }
> while destroy() method is
>     public void destroy() {
>         repo.shutdown();
>         super.destroy();
>     }
> Even when I applied patches from JCR-1636 and added TransientFileFactory.shutdown() call to destroy() method, nothing has changed.
> Tested this in Jetty 6.1.9 and Tomcat 6.0.14.

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


[jira] Resolved: (JCR-1668) After RepositoryImpl instance has been created and shut down, some classes cannot be unloaded

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

Martijn Hendriks resolved JCR-1668.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.0

Committed revision 796955.

> After RepositoryImpl instance has been created and shut down, some classes cannot be unloaded
> ---------------------------------------------------------------------------------------------
>
>                 Key: JCR-1668
>                 URL: https://issues.apache.org/jira/browse/JCR-1668
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core, jackrabbit-jcr-commons
>    Affects Versions: 1.4, commons 1.4.2, core 1.4.5
>         Environment: windows vista
> java version "1.6.0_06"
> Jetty 6.1.9
> Apache Tomcat 6.0.14
>            Reporter: Roman Puchkovskiy
>             Fix For: 2.0.0
>
>         Attachments: JCR-1636-reaper-thread.patch, JCR-1636.patch, test-undeploy-v2.zip
>
>
> I've built a simple web-application, which contains one servlet loaded at start-up. In its init() method an instance of RepositoryImpl() is created, in its destroy() method this instance is stopped (using shutdown()).
> From the servlet code, only classes in jackrabbit-core, JCR API and Servlet API are referenced.
> jackrabbit-core version is 1.4.5, and jackrabbit-jcr-commons version is 1.4.2. Other jackrabbit libs are all of 1.4 version.
> Even if servlet's doGet() method never gets called, when the web-application is redeployed, all its classes still hang in memory, which produces a memory leak.
> init() method is 
>     public void init() throws ServletException {
>         super.init();
>         try {
>             RepositoryConfig repoConfig = RepositoryConfig.create(getClass().getResourceAsStream("repository.xml"), ".");
>             repo = RepositoryImpl.create(repoConfig);
>         } catch (Exception e) {
>             throw new ServletException(e);
>         }
>     }
> while destroy() method is
>     public void destroy() {
>         repo.shutdown();
>         super.destroy();
>     }
> Even when I applied patches from JCR-1636 and added TransientFileFactory.shutdown() call to destroy() method, nothing has changed.
> Tested this in Jetty 6.1.9 and Tomcat 6.0.14.

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


[jira] Commented: (JCR-1668) After RepositoryImpl instance has been created and shut down, some classes cannot be unloaded

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12610586#action_12610586 ] 

Marcel Reutegger commented on JCR-1668:
---------------------------------------

The following worked for me:

- Deploy jackrabbit-webapp-1.5-SNAPSHOT into tomcat
- Stop tomcat
- *Move* derby-10.2.1.6.jar from WEB-INF/lib to commons/lib
- Redeploying the webapp several times will eventually unload obsolete classes

It seems there is a background thread in derby that prevents unloading of classes (AntiGC), unless you shutdown derby completely.
See: http://db.apache.org/derby/docs/10.4/devguide/tdevdvlp20349.html


> After RepositoryImpl instance has been created and shut down, some classes cannot be unloaded
> ---------------------------------------------------------------------------------------------
>
>                 Key: JCR-1668
>                 URL: https://issues.apache.org/jira/browse/JCR-1668
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core, jackrabbit-jcr-commons
>    Affects Versions: 1.4, commons 1.4.2, core 1.4.5
>         Environment: windows vista
> java version "1.6.0_06"
> Jetty 6.1.9
> Apache Tomcat 6.0.14
>            Reporter: Roman Puchkovskiy
>         Attachments: JCR-1636-reaper-thread.patch, test-undeploy-v2.zip
>
>
> I've built a simple web-application, which contains one servlet loaded at start-up. In its init() method an instance of RepositoryImpl() is created, in its destroy() method this instance is stopped (using shutdown()).
> From the servlet code, only classes in jackrabbit-core, JCR API and Servlet API are referenced.
> jackrabbit-core version is 1.4.5, and jackrabbit-jcr-commons version is 1.4.2. Other jackrabbit libs are all of 1.4 version.
> Even if servlet's doGet() method never gets called, when the web-application is redeployed, all its classes still hang in memory, which produces a memory leak.
> init() method is 
>     public void init() throws ServletException {
>         super.init();
>         try {
>             RepositoryConfig repoConfig = RepositoryConfig.create(getClass().getResourceAsStream("repository.xml"), ".");
>             repo = RepositoryImpl.create(repoConfig);
>         } catch (Exception e) {
>             throw new ServletException(e);
>         }
>     }
> while destroy() method is
>     public void destroy() {
>         repo.shutdown();
>         super.destroy();
>     }
> Even when I applied patches from JCR-1636 and added TransientFileFactory.shutdown() call to destroy() method, nothing has changed.
> Tested this in Jetty 6.1.9 and Tomcat 6.0.14.

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


[jira] Updated: (JCR-1668) After RepositoryImpl instance has been created and shut down, some classes cannot be unloaded

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

Roman Puchkovskiy updated JCR-1668:
-----------------------------------

    Attachment: JCR-1636-reaper-thread.patch

Attaching a patch improving initial JCR-1636 patch. The patch stops the reaper thread too when shutting the TransientFileFactory down.
But even with this patch applied, web-application behaves the same way when redeploying: classes are not unloaded.

> After RepositoryImpl instance has been created and shut down, some classes cannot be unloaded
> ---------------------------------------------------------------------------------------------
>
>                 Key: JCR-1668
>                 URL: https://issues.apache.org/jira/browse/JCR-1668
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core, jackrabbit-jcr-commons
>    Affects Versions: 1.4, commons 1.4.2, core 1.4.5
>         Environment: windows vista
> java version "1.6.0_06"
> Jetty 6.1.9
> Apache Tomcat 6.0.14
>            Reporter: Roman Puchkovskiy
>         Attachments: JCR-1636-reaper-thread.patch, test-undeploy.zip
>
>
> I've built a simple web-application, which contains one servlet loaded at start-up. In its init() method an instance of RepositoryImpl() is created, in its destroy() method this instance is stopped (using shutdown()).
> From the servlet code, only classes in jackrabbit-core, JCR API and Servlet API are referenced.
> jackrabbit-core version is 1.4.5, and jackrabbit-jcr-commons version is 1.4.2. Other jackrabbit libs are all of 1.4 version.
> Even if servlet's doGet() method never gets called, when the web-application is redeployed, all its classes still hang in memory, which produces a memory leak.
> init() method is 
>     public void init() throws ServletException {
>         super.init();
>         try {
>             RepositoryConfig repoConfig = RepositoryConfig.create(getClass().getResourceAsStream("repository.xml"), ".");
>             repo = RepositoryImpl.create(repoConfig);
>         } catch (Exception e) {
>             throw new ServletException(e);
>         }
>     }
> while destroy() method is
>     public void destroy() {
>         repo.shutdown();
>         super.destroy();
>     }
> Even when I applied patches from JCR-1636 and added TransientFileFactory.shutdown() call to destroy() method, nothing has changed.
> Tested this in Jetty 6.1.9 and Tomcat 6.0.14.

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


[jira] Updated: (JCR-1668) After RepositoryImpl instance has been created and shut down, some classes cannot be unloaded

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

Roman Puchkovskiy updated JCR-1668:
-----------------------------------

    Attachment: test-undeploy-v2.zip

Attaching a second version of web-application. It unregisters database drivers and shuts log4j down on servlet destroy. Introspector caches are flushed.
But still cannot be unloaded.

> After RepositoryImpl instance has been created and shut down, some classes cannot be unloaded
> ---------------------------------------------------------------------------------------------
>
>                 Key: JCR-1668
>                 URL: https://issues.apache.org/jira/browse/JCR-1668
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core, jackrabbit-jcr-commons
>    Affects Versions: 1.4, commons 1.4.2, core 1.4.5
>         Environment: windows vista
> java version "1.6.0_06"
> Jetty 6.1.9
> Apache Tomcat 6.0.14
>            Reporter: Roman Puchkovskiy
>         Attachments: JCR-1636-reaper-thread.patch, test-undeploy-v2.zip
>
>
> I've built a simple web-application, which contains one servlet loaded at start-up. In its init() method an instance of RepositoryImpl() is created, in its destroy() method this instance is stopped (using shutdown()).
> From the servlet code, only classes in jackrabbit-core, JCR API and Servlet API are referenced.
> jackrabbit-core version is 1.4.5, and jackrabbit-jcr-commons version is 1.4.2. Other jackrabbit libs are all of 1.4 version.
> Even if servlet's doGet() method never gets called, when the web-application is redeployed, all its classes still hang in memory, which produces a memory leak.
> init() method is 
>     public void init() throws ServletException {
>         super.init();
>         try {
>             RepositoryConfig repoConfig = RepositoryConfig.create(getClass().getResourceAsStream("repository.xml"), ".");
>             repo = RepositoryImpl.create(repoConfig);
>         } catch (Exception e) {
>             throw new ServletException(e);
>         }
>     }
> while destroy() method is
>     public void destroy() {
>         repo.shutdown();
>         super.destroy();
>     }
> Even when I applied patches from JCR-1636 and added TransientFileFactory.shutdown() call to destroy() method, nothing has changed.
> Tested this in Jetty 6.1.9 and Tomcat 6.0.14.

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


[jira] Updated: (JCR-1668) After RepositoryImpl instance has been created and shut down, some classes cannot be unloaded

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

Roman Puchkovskiy updated JCR-1668:
-----------------------------------

    Attachment: test-undeploy.zip

Attaching the test web-application.

> After RepositoryImpl instance has been created and shut down, some classes cannot be unloaded
> ---------------------------------------------------------------------------------------------
>
>                 Key: JCR-1668
>                 URL: https://issues.apache.org/jira/browse/JCR-1668
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core, jackrabbit-jcr-commons
>    Affects Versions: 1.4, commons 1.4.2, core 1.4.5
>         Environment: windows vista
> java version "1.6.0_06"
> Jetty 6.1.9
> Apache Tomcat 6.0.14
>            Reporter: Roman Puchkovskiy
>         Attachments: test-undeploy.zip
>
>
> I've built a simple web-application, which contains one servlet loaded at start-up. In its init() method an instance of RepositoryImpl() is created, in its destroy() method this instance is stopped (using shutdown()).
> From the servlet code, only classes in jackrabbit-core, JCR API and Servlet API are referenced.
> jackrabbit-core version is 1.4.5, and jackrabbit-jcr-commons version is 1.4.2. Other jackrabbit libs are all of 1.4 version.
> Even if servlet's doGet() method never gets called, when the web-application is redeployed, all its classes still hang in memory, which produces a memory leak.
> init() method is 
>     public void init() throws ServletException {
>         super.init();
>         try {
>             RepositoryConfig repoConfig = RepositoryConfig.create(getClass().getResourceAsStream("repository.xml"), ".");
>             repo = RepositoryImpl.create(repoConfig);
>         } catch (Exception e) {
>             throw new ServletException(e);
>         }
>     }
> while destroy() method is
>     public void destroy() {
>         repo.shutdown();
>         super.destroy();
>     }
> Even when I applied patches from JCR-1636 and added TransientFileFactory.shutdown() call to destroy() method, nothing has changed.
> Tested this in Jetty 6.1.9 and Tomcat 6.0.14.

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


[jira] Commented: (JCR-1668) After RepositoryImpl instance has been created and shut down, some classes cannot be unloaded

Posted by "Roman Puchkovskiy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12610828#action_12610828 ] 

Roman Puchkovskiy commented on JCR-1668:
----------------------------------------

Marcel, thanks for the link. The following line does the trick:
DriverManager.getConnection("jdbc:derby:;shutdown=true");


> After RepositoryImpl instance has been created and shut down, some classes cannot be unloaded
> ---------------------------------------------------------------------------------------------
>
>                 Key: JCR-1668
>                 URL: https://issues.apache.org/jira/browse/JCR-1668
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core, jackrabbit-jcr-commons
>    Affects Versions: 1.4, commons 1.4.2, core 1.4.5
>         Environment: windows vista
> java version "1.6.0_06"
> Jetty 6.1.9
> Apache Tomcat 6.0.14
>            Reporter: Roman Puchkovskiy
>         Attachments: JCR-1636-reaper-thread.patch, test-undeploy-v2.zip
>
>
> I've built a simple web-application, which contains one servlet loaded at start-up. In its init() method an instance of RepositoryImpl() is created, in its destroy() method this instance is stopped (using shutdown()).
> From the servlet code, only classes in jackrabbit-core, JCR API and Servlet API are referenced.
> jackrabbit-core version is 1.4.5, and jackrabbit-jcr-commons version is 1.4.2. Other jackrabbit libs are all of 1.4 version.
> Even if servlet's doGet() method never gets called, when the web-application is redeployed, all its classes still hang in memory, which produces a memory leak.
> init() method is 
>     public void init() throws ServletException {
>         super.init();
>         try {
>             RepositoryConfig repoConfig = RepositoryConfig.create(getClass().getResourceAsStream("repository.xml"), ".");
>             repo = RepositoryImpl.create(repoConfig);
>         } catch (Exception e) {
>             throw new ServletException(e);
>         }
>     }
> while destroy() method is
>     public void destroy() {
>         repo.shutdown();
>         super.destroy();
>     }
> Even when I applied patches from JCR-1636 and added TransientFileFactory.shutdown() call to destroy() method, nothing has changed.
> Tested this in Jetty 6.1.9 and Tomcat 6.0.14.

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