You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Kathey Marsden (JIRA)" <ji...@apache.org> on 2008/07/01 01:30:46 UTC

[jira] Created: (DERBY-3745) Derby can leak classloaders in an app server environment

Derby can leak classloaders in an app server environment
--------------------------------------------------------

                 Key: DERBY-3745
                 URL: https://issues.apache.org/jira/browse/DERBY-3745
             Project: Derby
          Issue Type: Bug
          Components: Services
    Affects Versions: 10.4.1.3, 10.3.3.0, 10.5.0.0
            Reporter: Kathey Marsden


A user reported potential class loader leaks in Derby

...The first one looks like Derby created a long-running
thread and copying the context class loader.  To fix, the
context class loader should be saved/set/restored around the
creation of the new thread so that it copies some benign class
loader instead (e.g., null or getClass().getClassLoader()):

 0x42278e58 java/lang/Thread@302e302e
  [truncating at running thread LEAK]

Object:  0x42278e58 java/lang/Thread@302e302e
Children:
 0x42278ee0 java/lang/String@303f303f
 0x4226e558 java/lang/ThreadGroup@6f2e6f2e
 0x42278e40
org/apache/derby/impl/services/monitor/AntiGC@603a603a
 0x419cfac0

The second is another long running thread.  The same applies:

 0x426fe7a0 java/lang/Thread@19901990
  [truncating at running thread LEAK]

Object:  0x426fe7a0 java/lang/Thread@19901990
Parents:
 0x4226e5a8 [Ljava/lang/Thread;@6f386f38
 0x426fe548
org/apache/derby/iapi/services/context/ContextManager@19421942
Children:
 0x426fe838 java/lang/String@19a319a3
 0x4226e558 java/lang/ThreadGroup@6f2e6f2e
 0x426fe4f8
org/apache/derby/impl/services/daemon/BasicDaemon@19381938
 0x419cfac0

The third is a TimerThread owneed , which is created when a
Timer is created.  The same applies:

 0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
  [truncating at running thread LEAK]

Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
Parents:
 0x41faaf58 [Ljava/lang/Thread;@3c583c58

Object:  0x425ac510 java/util/Timer@6b856b85
Parents:
 0x425ac500
org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
6e2

For more info, see thread at:
http://www.nabble.com/ClassLoader-leaks--td18121374.html


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


[jira] Commented: (DERBY-3745) Derby can leak classloaders in an app server environment

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12619645#action_12619645 ] 

Kathey Marsden commented on DERBY-3745:
---------------------------------------

Thanks Dan for catching this.  I will make yet another go at the patch.
Does this mean we should open a bug to remove PrivilegedFileOps as well?  That was added to the code quite a while ago.




> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>             Fix For: 10.3.3.1, 10.4.1.4, 10.5.0.0
>
>         Attachments: cdevbabejgjd.html, derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_BaseMonitor_cleanup_diff.txt, derby-3745_doc_diff.txt, derby-3745_policy_files_diff.txt, derby-3745_trunk_diff.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Commented: (DERBY-3745) Derby can leak classloaders in an app server environment

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12615797#action_12615797 ] 

Kathey Marsden commented on DERBY-3745:
---------------------------------------

Since we are listing the permissions as optional,  I wonder if it makes sense to add them to the default and template policy files after all, since these are geared more toward starting network server from the command line where the leak probably wouldn't be an issue.


> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>         Attachments: cdevbabejgjd.html, derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_doc_diff.txt, derby-3745_policy_files_diff.txt, derby-3745_trunk_diff.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Commented: (DERBY-3745) Derby can leak classloaders in an app server environment

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12622606#action_12622606 ] 

Myrna van Lunteren commented on DERBY-3745:
-------------------------------------------

I can take care of the backport...

> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>             Fix For: 10.4.2.0, 10.5.0.0
>
>         Attachments: cdevbabejgjd.html, derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_BaseMonitor_cleanup_diff.txt, derby-3745_doc_diff.txt, derby-3745_policy_files_diff.txt, derby-3745_removePrivThreadOps_diff.txt, derby-3745_trunk_diff.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Updated: (DERBY-3745) Derby can leak classloaders in an app server environment

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

Kathey Marsden updated DERBY-3745:
----------------------------------

    Fix Version/s: 10.3.3.1

> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>             Fix For: 10.3.3.1, 10.4.2.0, 10.5.0.0
>
>         Attachments: cdevbabejgjd.html, derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_BaseMonitor_cleanup_diff.txt, derby-3745_doc_diff.txt, derby-3745_fix_build_warning_diff.txt, derby-3745_policy_files_diff.txt, derby-3745_removePrivThreadOps_diff.txt, derby-3745_trunk_diff.txt, derby3745_backport_to_104_diff_v1.txt, derby3745_backport_to_104_stat_v1.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Closed: (DERBY-3745) Derby can leak classloaders in an app server environment

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

Kathey Marsden closed DERBY-3745.
---------------------------------


> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>             Fix For: 10.3.3.1, 10.4.2.0, 10.5.0.0
>
>         Attachments: cdevbabejgjd.html, derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_BaseMonitor_cleanup_diff.txt, derby-3745_doc_diff.txt, derby-3745_fix_build_warning_diff.txt, derby-3745_policy_files_diff.txt, derby-3745_removePrivThreadOps_diff.txt, derby-3745_trunk_diff.txt, derby3745_backport_to_104_diff_v1.txt, derby3745_backport_to_104_stat_v1.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Commented: (DERBY-3745) Derby can leak classloaders in an app server environment

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12609672#action_12609672 ] 

Kathey Marsden commented on DERBY-3745:
---------------------------------------

The only thing I can think of to do to fix this is to 
1) Document that derby.jar requires getContextClassLoader/setContextClasssLoader privileges.
2) Change the code to attempt to set the context class loader to null for these threads if we have permissions and ignore security exceptions if we are not able to. (Leave the potential for class loader leaks)
3) Change sample, test and default policy files to have these privileges.

Thoughts?

Kathey


> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Commented: (DERBY-3745) Derby can leak classloaders in an app server environment

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12616690#action_12616690 ] 

Kathey Marsden commented on DERBY-3745:
---------------------------------------

Well I have a 50./50 chance of getting this right, so I guess I will say let's *not*  add the new permissions to the server default and template policy files, since they seem primarily focussed on network server permissions needed when starting from the command  line.  I will  make the doc change to make these permissions optional and will commit the patch derby-3745_Base_Monitor_cleanup_diff.txt.  Let me know if you have any concerns.


> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>         Attachments: cdevbabejgjd.html, derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_BaseMonitor_cleanup_diff.txt, derby-3745_doc_diff.txt, derby-3745_policy_files_diff.txt, derby-3745_trunk_diff.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Commented: (DERBY-3745) Derby can leak classloaders in an app server environment

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12622951#action_12622951 ] 

Myrna van Lunteren commented on DERBY-3745:
-------------------------------------------

I committed the patch to fix the build warning with revision 686296. Thanks Kathey.

> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>             Fix For: 10.4.2.0, 10.5.0.0
>
>         Attachments: cdevbabejgjd.html, derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_BaseMonitor_cleanup_diff.txt, derby-3745_doc_diff.txt, derby-3745_fix_build_warning_diff.txt, derby-3745_policy_files_diff.txt, derby-3745_removePrivThreadOps_diff.txt, derby-3745_trunk_diff.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Commented: (DERBY-3745) Derby can leak classloaders in an app server environment

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12624605#action_12624605 ] 

Knut Anders Hatlen commented on DERBY-3745:
-------------------------------------------

The patch looks fine to me. +1 to commit.

> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>             Fix For: 10.4.2.0, 10.5.0.0
>
>         Attachments: cdevbabejgjd.html, derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_BaseMonitor_cleanup_diff.txt, derby-3745_doc_diff.txt, derby-3745_fix_build_warning_diff.txt, derby-3745_policy_files_diff.txt, derby-3745_removePrivThreadOps_diff.txt, derby-3745_trunk_diff.txt, derby3745_backport_to_104_diff_v1.txt, derby3745_backport_to_104_stat_v1.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Reopened: (DERBY-3745) Derby can leak classloaders in an app server environment

Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3745?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel John Debrunner reopened DERBY-3745:
------------------------------------------

    Derby Categories: [Security]

-1 on the patch that added the class PrivilegedThreadOps.

This class allows other code to bypass security and inherit permissions that are granted to Derby's codebase.

Writing a utility class for privileged blocks is strongly discouraged by the Java documentation: "Do not be tempted to write a utility class that itself calls doPrivileged as that could lead to security holes. "

http://java.sun.com/javase/6/docs/technotes/guides/security/doprivileged.html

> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>             Fix For: 10.3.3.1, 10.4.1.4, 10.5.0.0
>
>         Attachments: cdevbabejgjd.html, derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_BaseMonitor_cleanup_diff.txt, derby-3745_doc_diff.txt, derby-3745_policy_files_diff.txt, derby-3745_trunk_diff.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Commented: (DERBY-3745) Derby can leak classloaders in an app server environment

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12612200#action_12612200 ] 

Kathey Marsden commented on DERBY-3745:
---------------------------------------

The reporting user is out this week.  I will let this patch sit until he returns or we get answers to Knut's questions.


> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>         Attachments: derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Resolved: (DERBY-3745) Derby can leak classloaders in an app server environment

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

Rick Hillegas resolved DERBY-3745.
----------------------------------

    Resolution: Fixed

Resolving this issue so that it will appear in the 10.4.2 release notes. It appears to me that the patch has been ported to 10.4.

> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>             Fix For: 10.4.2.0, 10.5.0.0
>
>         Attachments: cdevbabejgjd.html, derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_BaseMonitor_cleanup_diff.txt, derby-3745_doc_diff.txt, derby-3745_fix_build_warning_diff.txt, derby-3745_policy_files_diff.txt, derby-3745_removePrivThreadOps_diff.txt, derby-3745_trunk_diff.txt, derby3745_backport_to_104_diff_v1.txt, derby3745_backport_to_104_stat_v1.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Updated: (DERBY-3745) Derby can leak classloaders in an app server environment

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

Kathey Marsden updated DERBY-3745:
----------------------------------

    Attachment: derby-3745_10.3_diff2.txt

Thanks Knut Anders for reviewing the patch.
Here is a patch updated with Knut's comments.  I asked the user that filed this case and suggested the fix to comment on the  questions. My understanding of the class loader issues is somewhat limited so I myself am not that comfortable with the fix.  Perhaps Dan could take a look too.



> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>         Attachments: derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Updated: (DERBY-3745) Derby can leak classloaders in an app server environment

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3745?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Myrna van Lunteren updated DERBY-3745:
--------------------------------------

    Derby Info:   (was: [Patch Available])

The patch was committed.
I'm leaving this open for backport to 10.4, but I'm not sure I can get it done in time for 10.4 point release. If anyone else has some cycles...

> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>             Fix For: 10.4.2.0, 10.5.0.0
>
>         Attachments: cdevbabejgjd.html, derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_BaseMonitor_cleanup_diff.txt, derby-3745_doc_diff.txt, derby-3745_fix_build_warning_diff.txt, derby-3745_policy_files_diff.txt, derby-3745_removePrivThreadOps_diff.txt, derby-3745_trunk_diff.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Updated: (DERBY-3745) Derby can leak classloaders in an app server environment

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

Kathey Marsden updated DERBY-3745:
----------------------------------

    Attachment: derby-3745_removePrivThreadOps_diff.txt

Attached is a trunk patch to inline the doPrivileged blocks and remove PrivilegedThreadOps.  Please review.


> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>             Fix For: 10.4.2.0, 10.5.0.0
>
>         Attachments: cdevbabejgjd.html, derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_BaseMonitor_cleanup_diff.txt, derby-3745_doc_diff.txt, derby-3745_policy_files_diff.txt, derby-3745_removePrivThreadOps_diff.txt, derby-3745_trunk_diff.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Commented: (DERBY-3745) Derby can leak classloaders in an app server environment

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12609408#action_12609408 ] 

Kathey Marsden commented on DERBY-3745:
---------------------------------------

One problem with setting the contextClasssLoader for the new threads is that we don't document that setContextClassLoader permission is required for derby.jar, so trying it I get java.security.AccessControlException: access denied (java.lang.RuntimePermission setContextClassLoader) using the default testing policy file.



> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Commented: (DERBY-3745) Derby can leak classloaders in an app server environment

Posted by "Dag H. Wanvik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12647350#action_12647350 ] 

Dag H. Wanvik commented on DERBY-3745:
--------------------------------------

DERBY-3887 points to a possible problem with the fix for this issue. I do not know
what the right solution is, though.


> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>             Fix For: 10.3.3.1, 10.4.2.0, 10.5.0.0
>
>         Attachments: cdevbabejgjd.html, derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_BaseMonitor_cleanup_diff.txt, derby-3745_doc_diff.txt, derby-3745_fix_build_warning_diff.txt, derby-3745_policy_files_diff.txt, derby-3745_removePrivThreadOps_diff.txt, derby-3745_trunk_diff.txt, derby3745_backport_to_104_diff_v1.txt, derby3745_backport_to_104_stat_v1.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Resolved: (DERBY-3745) Derby can leak classloaders in an app server environment

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

Kathey Marsden resolved DERBY-3745.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 10.5.0.0
                   10.4.1.4
                   10.3.3.1

> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>             Fix For: 10.3.3.1, 10.4.1.4, 10.5.0.0
>
>         Attachments: cdevbabejgjd.html, derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_BaseMonitor_cleanup_diff.txt, derby-3745_doc_diff.txt, derby-3745_policy_files_diff.txt, derby-3745_trunk_diff.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Updated: (DERBY-3745) Derby can leak classloaders in an app server environment

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

Kathey Marsden updated DERBY-3745:
----------------------------------

    Derby Info: [Patch Available]

derby-3745_doc_diff.txt, derby-3745_policy_files_diff.txt ready for review.


> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>         Attachments: cdevbabejgjd.html, derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_doc_diff.txt, derby-3745_policy_files_diff.txt, derby-3745_trunk_diff.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Updated: (DERBY-3745) Derby can leak classloaders in an app server environment

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

Kathey Marsden updated DERBY-3745:
----------------------------------

    Derby Info: [Patch Available]

regression tests passed.

> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>         Attachments: derby-3745_10.3_diff.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Commented: (DERBY-3745) Derby can leak classloaders in an app server environment

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12612805#action_12612805 ] 

Knut Anders Hatlen commented on DERBY-3745:
-------------------------------------------

It looks like the indentation is wrong in JMXManagementService.findServer().

> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>         Attachments: derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_trunk_diff.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Commented: (DERBY-3745) Derby can leak classloaders in an app server environment

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12622907#action_12622907 ] 

Kathey Marsden commented on DERBY-3745:
---------------------------------------

I ran suites.All and all passed.  Since derbyall doesn't touch JMX I didn't run that.


> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>             Fix For: 10.4.2.0, 10.5.0.0
>
>         Attachments: cdevbabejgjd.html, derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_BaseMonitor_cleanup_diff.txt, derby-3745_doc_diff.txt, derby-3745_fix_build_warning_diff.txt, derby-3745_policy_files_diff.txt, derby-3745_removePrivThreadOps_diff.txt, derby-3745_trunk_diff.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Updated: (DERBY-3745) Derby can leak classloaders in an app server environment

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

Kathey Marsden updated DERBY-3745:
----------------------------------

    Attachment: derby-3745_fix_build_warning_diff.txt

Myrna said this fix was causing a new build warning. Unfortunately I am not seeing the build warning in my environment, so I can't verify the fix, but I think this patch should fix it.  Could someone who is seeing the warning give this a try.  The warning is 
C:\nightlies\main\src\opensource\java\engine\org\apache\derby\impl\services\jmx\JMXManagementService.java uses unchecked or unsafe operations.
my jdk15lib points to this jvm:

java version "1.5.0_13"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05)
Java HotSpot(TM) Client VM (build 1.5.0_13-b05, mixed mode)


> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>             Fix For: 10.4.2.0, 10.5.0.0
>
>         Attachments: cdevbabejgjd.html, derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_BaseMonitor_cleanup_diff.txt, derby-3745_doc_diff.txt, derby-3745_fix_build_warning_diff.txt, derby-3745_policy_files_diff.txt, derby-3745_removePrivThreadOps_diff.txt, derby-3745_trunk_diff.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Commented: (DERBY-3745) Derby can leak classloaders in an app server environment

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12615705#action_12615705 ] 

Kathey Marsden commented on DERBY-3745:
---------------------------------------

Thanks Dan. I'll take another look and at least add the comment if I can't figure it out.



> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>         Attachments: cdevbabejgjd.html, derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_doc_diff.txt, derby-3745_policy_files_diff.txt, derby-3745_trunk_diff.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Commented: (DERBY-3745) Derby can leak classloaders in an app server environment

Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12615681#action_12615681 ] 

Daniel John Debrunner commented on DERBY-3745:
----------------------------------------------

Why unset and then reset the context class loader for the current thread? Why not just set the class loader for the created thread to null? Simpler code.

> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>         Attachments: cdevbabejgjd.html, derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_doc_diff.txt, derby-3745_policy_files_diff.txt, derby-3745_trunk_diff.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Updated: (DERBY-3745) Derby can leak classloaders in an app server environment

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

Kathey Marsden updated DERBY-3745:
----------------------------------

    Derby Info:   (was: [Patch Available])

In the instance of the Timer thread and the thread  that starts with the MBean server I don't have direct access to the thread so cannot do that.  In the case of the daemon threads I tried setting the context class loader directly but found it still leaked (not sure why) so I reverted to this method.

I'll change the doc to make the permissions optional.

> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>         Attachments: cdevbabejgjd.html, derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_doc_diff.txt, derby-3745_policy_files_diff.txt, derby-3745_trunk_diff.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Commented: (DERBY-3745) Derby can leak classloaders in an app server environment

Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12615685#action_12615685 ] 

Daniel John Debrunner commented on DERBY-3745:
----------------------------------------------

> Doc update for new permissions requirement. I put it under mandatory. 

Why mandatory? The patch is not coded that the permission is mandatory, nor is it required in all situations.

> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>         Attachments: cdevbabejgjd.html, derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_doc_diff.txt, derby-3745_policy_files_diff.txt, derby-3745_trunk_diff.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Updated: (DERBY-3745) Derby can leak classloaders in an app server environment

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

Kathey Marsden updated DERBY-3745:
----------------------------------

    Derby Info:   (was: [Patch Available])

> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>         Attachments: derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_trunk_diff.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Updated: (DERBY-3745) Derby can leak classloaders in an app server environment

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

Kathey Marsden updated DERBY-3745:
----------------------------------

    Derby Info: [Patch Available]

> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>             Fix For: 10.4.2.0, 10.5.0.0
>
>         Attachments: cdevbabejgjd.html, derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_BaseMonitor_cleanup_diff.txt, derby-3745_doc_diff.txt, derby-3745_policy_files_diff.txt, derby-3745_removePrivThreadOps_diff.txt, derby-3745_trunk_diff.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Commented: (DERBY-3745) Derby can leak classloaders in an app server environment

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12612466#action_12612466 ] 

Knut Anders Hatlen commented on DERBY-3745:
-------------------------------------------

Thanks for the new patch! If I have understood correctly what a context class loader is, I don't think the patch should do any harm (none of Derby's daemon threads should ever use the context class loader, should they?). I just had a feeling that we might have been trying to fix the problem the wrong place, but I think you're right that the impact of the fix should be limited, so I'm fine with it.

If it is the case that some of Derby's threads are not stopped when the driver is unloaded, that should be treated as a bug, and a separate JIRA issue should be filed for it to get it fixed.

(Two tiny nits: (a) one line in one of the comment in SingletonTimerFactory is indented with space+tab+space, and (b) trailing white-space has been added after the end-of-method brace in the same file)

> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>         Attachments: derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Updated: (DERBY-3745) Derby can leak classloaders in an app server environment

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

Kathey Marsden updated DERBY-3745:
----------------------------------

    Attachment: derby-3745_policy_files_diff.txt

Attached is a patch to update the default and template policy files to contain.
  permission java.lang.RuntimePermission "getClassLoader";
  permission java.lang.RuntimePermission "setContextClassLoader";


> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>         Attachments: derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_policy_files_diff.txt, derby-3745_trunk_diff.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Assigned: (DERBY-3745) Derby can leak classloaders in an app server environment

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

Kathey Marsden reassigned DERBY-3745:
-------------------------------------

    Assignee: Kathey Marsden

> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Commented: (DERBY-3745) Derby can leak classloaders in an app server environment

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12622905#action_12622905 ] 

Myrna van Lunteren commented on DERBY-3745:
-------------------------------------------

Your patch fixes the warning. 
Did you run tests, or should I?



> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>             Fix For: 10.4.2.0, 10.5.0.0
>
>         Attachments: cdevbabejgjd.html, derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_BaseMonitor_cleanup_diff.txt, derby-3745_doc_diff.txt, derby-3745_fix_build_warning_diff.txt, derby-3745_policy_files_diff.txt, derby-3745_removePrivThreadOps_diff.txt, derby-3745_trunk_diff.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Updated: (DERBY-3745) Derby can leak classloaders in an app server environment

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

Kathey Marsden updated DERBY-3745:
----------------------------------

    Attachment: derby-3745_trunk_diff.txt

Here is a patch for the trunk and I will port the same change to 10.4. It is the same as the 10.3 patch except for the change to JMXManagementService.java to save/set/restore the context class loader around ManagementFactory.getPlatformMBeanServer() which launches a thread, at least on IBM JVM's.

I will follow up on trunk only with the doc change and template/default policy file change.


> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>         Attachments: derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_trunk_diff.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Commented: (DERBY-3745) Derby can leak classloaders in an app server environment

Posted by "Brett Kail (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12612304#action_12612304 ] 

Brett Kail commented on DERBY-3745:
-----------------------------------

If code is creating a background Thread for its own purposes, then it needs to ensure that it does not hold on to an application class loader.  This is true for any code intended to run in an application server environment.

If the driver is unloaded, then Derby did seem to properly stop threads in the testcase I looked at.  However, in an application server environment, the Derby driver cannot be unloaded when a single application is stopped since there can be many applications running that all depend on Derby.

> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>         Attachments: derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Commented: (DERBY-3745) Derby can leak classloaders in an app server environment

Posted by "Suran Jayathilaka (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12622325#action_12622325 ] 

Suran Jayathilaka commented on DERBY-3745:
------------------------------------------

derby-3745_removePrivThreadOps_diff.txt reviewed. 
Except for a few very trivial style nits (missing spaces) in a few places, the inlining of the PrivilegedThread operations seems equivalent to the utility method calls.

> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>             Fix For: 10.4.2.0, 10.5.0.0
>
>         Attachments: cdevbabejgjd.html, derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_BaseMonitor_cleanup_diff.txt, derby-3745_doc_diff.txt, derby-3745_policy_files_diff.txt, derby-3745_removePrivThreadOps_diff.txt, derby-3745_trunk_diff.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Commented: (DERBY-3745) Derby can leak classloaders in an app server environment

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12611962#action_12611962 ] 

Knut Anders Hatlen commented on DERBY-3745:
-------------------------------------------

I don't know enough about class loading issues to tell whether or not the approach is OK. A couple of questions, though:

  - Is it Derby's responsibility to set the context class loader for every thread that it spawns, or should the application rather set the context class loader to the appropriate value (null?) when loading the Derby driver? It sounds to me like Derby behaves as expected by using the current context class loader, and I don't know if changing it could cause problems in other scenarios.

  - Does Derby prevent the class loader from being garbage collected after the driver has been unloaded? If not, I would think it was the application's responsibility to unload the driver when it wants all resources to be freed.

Other than that, the patch looks fine to me. Some nits:
- You may want to use spaces instead of tabs in SingletonTimerFactory, since that's what's used in the rest of the file.
- Some of the @param tags in PrivilegedThreadOps are empty.
- SecurityException is a RuntimeException, so the PrivilegedThreadOps should use PrivilegedAction instead of PrivilegedExceptionAction (if the code in the catch block is ever executed, the cast to SecurityException is guaranteed to fail since PrivilegedActionExceptions only wrap checked exceptions).
- Typo in javadoc for setCCLIfPrivileged: priveleged --> privileged

> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>         Attachments: derby-3745_10.3_diff.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Updated: (DERBY-3745) Derby can leak classloaders in an app server environment

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

Kathey Marsden updated DERBY-3745:
----------------------------------

    Attachment: derby-3745_10.3_diff.txt

Attached is a patch for this issue for the 10.3 branch.  This takes care of the leak for 10.3, but the same change on trunk still shows a leak related to com/ibm/lang/management/MemoryNotificationThread
There must be some additional change related to jmx that is necessary.  I  would like to go ahead and check in this change to get a fix for 10.3 and track down the trunk issue separately.

I wasn't sure how to add a test for this, so didn't.  I verified manually using the IBM Heap analyzer and the test program supplied by the user.

I am running regresssion tests now.


> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>         Attachments: derby-3745_10.3_diff.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Updated: (DERBY-3745) Derby can leak classloaders in an app server environment

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

Kathey Marsden updated DERBY-3745:
----------------------------------

    Attachment: cdevbabejgjd.html
                derby-3745_doc_diff.txt

Doc update for new permissions requirement. I put it under mandatory.


> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>         Attachments: cdevbabejgjd.html, derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_doc_diff.txt, derby-3745_policy_files_diff.txt, derby-3745_trunk_diff.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Updated: (DERBY-3745) Derby can leak classloaders in an app server environment

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

Kathey Marsden updated DERBY-3745:
----------------------------------

    Attachment: derby-3745_BaseMonitor_cleanup_diff.txt

Of course on retry it all seems to work properly now to set the context classloader directly on the thread.  I can't say what I was doing wrong before.
Attached is derby-3745_BaseMonitor_cleanup_diff.txt to clean it up.


> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>         Attachments: cdevbabejgjd.html, derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_BaseMonitor_cleanup_diff.txt, derby-3745_doc_diff.txt, derby-3745_policy_files_diff.txt, derby-3745_trunk_diff.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Commented: (DERBY-3745) Derby can leak classloaders in an app server environment

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12615323#action_12615323 ] 

Kathey Marsden commented on DERBY-3745:
---------------------------------------

Does anyone have thoughts as to whether the new permissions should go under Mandatory or Optional  permissions?


> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>         Attachments: derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_trunk_diff.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Commented: (DERBY-3745) Derby can leak classloaders in an app server environment

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12622602#action_12622602 ] 

Kathey Marsden commented on DERBY-3745:
---------------------------------------

It would be good to get the last patch for this issue (revision 685674) merged to 10.4 for the release, but we should wait until test results are in on the trunk fix first.  I won't be around, so hopefully someone else can merge the fix back to 10.4.




> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>             Fix For: 10.4.2.0, 10.5.0.0
>
>         Attachments: cdevbabejgjd.html, derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_BaseMonitor_cleanup_diff.txt, derby-3745_doc_diff.txt, derby-3745_policy_files_diff.txt, derby-3745_removePrivThreadOps_diff.txt, derby-3745_trunk_diff.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Commented: (DERBY-3745) Derby can leak classloaders in an app server environment

Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12615702#action_12615702 ] 

Daniel John Debrunner commented on DERBY-3745:
----------------------------------------------

Probably good to comment in the getDaemonThread() case why it's not being done the simpler way, though I'm pretty sure the simpler way will have the same effect. It would be good to investigate why the leak did not go away when setting the context class loader directly for the new thread.

> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>         Attachments: cdevbabejgjd.html, derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_doc_diff.txt, derby-3745_policy_files_diff.txt, derby-3745_trunk_diff.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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


[jira] Updated: (DERBY-3745) Derby can leak classloaders in an app server environment

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3745?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mamta A. Satoor updated DERBY-3745:
-----------------------------------

    Attachment: derby3745_backport_to_104_stat_v1.txt
                derby3745_backport_to_104_diff_v1.txt

I am planning on backporting the attached patch to 10.4 codeline in few minutes. The backporting includes revisions 679620, 685674 and 686296 from the trunk. 

derbyall tests ran fine. I ran junit test suites with classes and with jar files after backporting the changes to my 10.4 client. With classes, I ran into DERBY-3836 but didn't run into DERBY-3836 with jar files. I did run into some out of memory issues but I think it might be local to my machine because of all the other processes running on the machine and probably not enough memory to the junit tests when I specified -Xmx1024m. I will keep an eye on the 10.4 test runs after I commit the changes. 

> Derby can leak classloaders in an app server environment
> --------------------------------------------------------
>
>                 Key: DERBY-3745
>                 URL: https://issues.apache.org/jira/browse/DERBY-3745
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>             Fix For: 10.4.2.0, 10.5.0.0
>
>         Attachments: cdevbabejgjd.html, derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt, derby-3745_BaseMonitor_cleanup_diff.txt, derby-3745_doc_diff.txt, derby-3745_fix_build_warning_diff.txt, derby-3745_policy_files_diff.txt, derby-3745_removePrivThreadOps_diff.txt, derby-3745_trunk_diff.txt, derby3745_backport_to_104_diff_v1.txt, derby3745_backport_to_104_stat_v1.txt
>
>
> A user reported potential class loader leaks in Derby
> ...The first one looks like Derby created a long-running
> thread and copying the context class loader.  To fix, the
> context class loader should be saved/set/restored around the
> creation of the new thread so that it copies some benign class
> loader instead (e.g., null or getClass().getClassLoader()):
>  0x42278e58 java/lang/Thread@302e302e
>   [truncating at running thread LEAK]
> Object:  0x42278e58 java/lang/Thread@302e302e
> Children:
>  0x42278ee0 java/lang/String@303f303f
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x42278e40
> org/apache/derby/impl/services/monitor/AntiGC@603a603a
>  0x419cfac0
> The second is another long running thread.  The same applies:
>  0x426fe7a0 java/lang/Thread@19901990
>   [truncating at running thread LEAK]
> Object:  0x426fe7a0 java/lang/Thread@19901990
> Parents:
>  0x4226e5a8 [Ljava/lang/Thread;@6f386f38
>  0x426fe548
> org/apache/derby/iapi/services/context/ContextManager@19421942
> Children:
>  0x426fe838 java/lang/String@19a319a3
>  0x4226e558 java/lang/ThreadGroup@6f2e6f2e
>  0x426fe4f8
> org/apache/derby/impl/services/daemon/BasicDaemon@19381938
>  0x419cfac0
> The third is a TimerThread owneed , which is created when a
> Timer is created.  The same applies:
>  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
>   [truncating at running thread LEAK]
> Object:  0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
> Parents:
>  0x41faaf58 [Ljava/lang/Thread;@3c583c58
> Object:  0x425ac510 java/util/Timer@6b856b85
> Parents:
>  0x425ac500
> org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
> 6e2
> For more info, see thread at:
> http://www.nabble.com/ClassLoader-leaks--td18121374.html

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