You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@excalibur.apache.org by "Pawel Stawicki (JIRA)" <de...@excalibur.apache.org> on 2005/02/09 16:04:14 UTC

[jira] Created: (EXLBR-20) org.apache.avalon.excalibur.thread.impl.DefaultThreadPool is not disposed properly.

org.apache.avalon.excalibur.thread.impl.DefaultThreadPool is not disposed properly.
-----------------------------------------------------------------------------------

         Key: EXLBR-20
         URL: http://issues.apache.org/jira/browse/EXLBR-20
     Project: Excalibur Components
        Type: Bug
  Components: Thread  
    Reporter: Pawel Stawicki
    Priority: Minor


DefaultThreadPool extends ThreadGroup. When it is created and added to parent ThreadGroup, ThreadGroup holds reference to it. When dispose is called, parent ThreadGroup still has reference to it and garbage collector can not collect it. It causes memory leak.

This can be solved by calling destroy() in dispose method.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@excalibur.apache.org
For additional commands, e-mail: dev-help@excalibur.apache.org


[jira] Resolved: (EXLBR-20) org.apache.avalon.excalibur.thread.impl.DefaultThreadPool is not disposed properly.

Posted by "Shash Chatterjee (JIRA)" <de...@excalibur.apache.org>.
     [ http://issues.apache.org/jira/browse/EXLBR-20?page=history ]
     
Shash Chatterjee resolved EXLBR-20:
-----------------------------------

    Resolution: Fixed

Date: Sat Apr 16 07:31:25 2005
New Revision: 161572

URL: http://svn.apache.org/viewcvs?view=rev&rev=161572
Log:
Pathc from: http://issues.apache.org/jira/browse/EXLBR-20
Fixes: DefaultThreadPool extends ThreadGroup. When it is created and added to parent ThreadGroup, ThreadGroup holds reference to it. When dispose is called, parent ThreadGroup still has reference to it and garbage collector can not collect it. It causes memory leak. 

Modified:
    excalibur/trunk/components/thread/impl/src/java/org/apache/avalon/excalibur/thread/impl/DefaultThreadPool.java





> org.apache.avalon.excalibur.thread.impl.DefaultThreadPool is not disposed properly.
> -----------------------------------------------------------------------------------
>
>          Key: EXLBR-20
>          URL: http://issues.apache.org/jira/browse/EXLBR-20
>      Project: Excalibur Components
>         Type: Bug
>   Components: Thread
>     Reporter: Pawel Stawicki
>     Assignee: Shash Chatterjee
>     Priority: Minor

>
> DefaultThreadPool extends ThreadGroup. When it is created and added to parent ThreadGroup, ThreadGroup holds reference to it. When dispose is called, parent ThreadGroup still has reference to it and garbage collector can not collect it. It causes memory leak.
> This can be solved by calling destroy() in dispose method.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@excalibur.apache.org
For additional commands, e-mail: dev-help@excalibur.apache.org


[jira] Closed: (EXLBR-20) org.apache.avalon.excalibur.thread.impl.DefaultThreadPool is not disposed properly.

Posted by "Shash Chatterjee (JIRA)" <de...@excalibur.apache.org>.
     [ http://issues.apache.org/jira/browse/EXLBR-20?page=history ]
     
Shash Chatterjee closed EXLBR-20:
---------------------------------


Will be released with version 2.1

> org.apache.avalon.excalibur.thread.impl.DefaultThreadPool is not disposed properly.
> -----------------------------------------------------------------------------------
>
>          Key: EXLBR-20
>          URL: http://issues.apache.org/jira/browse/EXLBR-20
>      Project: Excalibur Components
>         Type: Bug
>   Components: Thread
>     Reporter: Pawel Stawicki
>     Assignee: Shash Chatterjee
>     Priority: Minor

>
> DefaultThreadPool extends ThreadGroup. When it is created and added to parent ThreadGroup, ThreadGroup holds reference to it. When dispose is called, parent ThreadGroup still has reference to it and garbage collector can not collect it. It causes memory leak.
> This can be solved by calling destroy() in dispose method.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@excalibur.apache.org
For additional commands, e-mail: dev-help@excalibur.apache.org


[jira] Commented: (EXLBR-20) org.apache.avalon.excalibur.thread.impl.DefaultThreadPool is not disposed properly.

Posted by "Markus Wiederkehr (JIRA)" <de...@excalibur.apache.org>.
    [ https://issues.apache.org/jira/browse/EXLBR-20?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12631004#action_12631004 ] 

Markus Wiederkehr commented on EXLBR-20:
----------------------------------------

I think a new bug was introduced by fixing this one and this issue should be re-opened.

A ThreadGroup cannot be destroyed if it still contains threads. ThreadGroup throws an IllegalThreadStateException if the group is not empty.

More specifically the DefaultThreadPool code from version 2.1 looks like this:
  public void dispose()
  {
    m_pool.dispose();
    this.destroy();
  }

m_pool is a BasicThreadPool which in turn has an underlying pool also called m_pool. Now assume that underlying pool is a SoftResourceLimitingPool from excalibur-pool-impl-2.1.jar.

The dispose() method of SoftResourceLimitingPool (declared in DefaultPool) removed all Poolable elements from its ready pool m_ready. But it does not do anything about the active elements in m_active.

As a consequence the thread group may not be empty and an IllegalThreadStateException is thrown.

See also JAMES-767 for an issue where this actually happens.

> org.apache.avalon.excalibur.thread.impl.DefaultThreadPool is not disposed properly.
> -----------------------------------------------------------------------------------
>
>                 Key: EXLBR-20
>                 URL: https://issues.apache.org/jira/browse/EXLBR-20
>             Project: Excalibur Components
>          Issue Type: Bug
>          Components: Thread
>            Reporter: Pawel Stawicki
>            Assignee: Shash Chatterjee
>            Priority: Minor
>
> DefaultThreadPool extends ThreadGroup. When it is created and added to parent ThreadGroup, ThreadGroup holds reference to it. When dispose is called, parent ThreadGroup still has reference to it and garbage collector can not collect it. It causes memory leak.
> This can be solved by calling destroy() in dispose method.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@excalibur.apache.org
For additional commands, e-mail: dev-help@excalibur.apache.org


[jira] Assigned: (EXLBR-20) org.apache.avalon.excalibur.thread.impl.DefaultThreadPool is not disposed properly.

Posted by "Shash Chatterjee (JIRA)" <de...@excalibur.apache.org>.
     [ http://issues.apache.org/jira/browse/EXLBR-20?page=history ]

Shash Chatterjee reassigned EXLBR-20:
-------------------------------------

    Assign To: Shash Chatterjee

> org.apache.avalon.excalibur.thread.impl.DefaultThreadPool is not disposed properly.
> -----------------------------------------------------------------------------------
>
>          Key: EXLBR-20
>          URL: http://issues.apache.org/jira/browse/EXLBR-20
>      Project: Excalibur Components
>         Type: Bug
>   Components: Thread
>     Reporter: Pawel Stawicki
>     Assignee: Shash Chatterjee
>     Priority: Minor

>
> DefaultThreadPool extends ThreadGroup. When it is created and added to parent ThreadGroup, ThreadGroup holds reference to it. When dispose is called, parent ThreadGroup still has reference to it and garbage collector can not collect it. It causes memory leak.
> This can be solved by calling destroy() in dispose method.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@excalibur.apache.org
For additional commands, e-mail: dev-help@excalibur.apache.org