You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Przemo Pakulski (JIRA)" <ji...@apache.org> on 2006/04/12 14:05:28 UTC

[jira] Created: (JCR-395) Using transactions leads to memory leak

Using transactions leads to memory leak
---------------------------------------

         Key: JCR-395
         URL: http://issues.apache.org/jira/browse/JCR-395
     Project: Jackrabbit
        Type: Bug

  Components: transactions  
    Reporter: Przemo Pakulski


There is global static map in XASessionImpl class which stores all Xids and TransactionContexts

    /**
     * Global transactions
     */
    private static final Map txGlobal = new HashMap();

It looks like this map is never cleared, even after end of transaction. It leads to memory leak because TransactionContexts and all nested objects (including XASessionImpl) are still referenced and couldn't be freed.

Proposed solution : Is it posssible to add just single line which will remove TransactionContext from static map at the end of transaction ?

      if (flags == TMSUCCESS || flags == TMFAIL) {
            associate(null);
-->       txGlobal.remove(xid);
        } else  if (flags == TMSUSPEND) {
            associate(null);
        } else {
            throw new XAException(XAException.XAER_INVAL);
        }

If this is not acceptable, then we have to unreference TransactionContext in another way.

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


[jira] Assigned: (JCR-395) Using transactions leads to memory leak

Posted by "Tobias Bocanegra (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-395?page=all ]

Tobias Bocanegra reassigned JCR-395:
------------------------------------

    Assign To: Tobias Bocanegra

> Using transactions leads to memory leak
> ---------------------------------------
>
>          Key: JCR-395
>          URL: http://issues.apache.org/jira/browse/JCR-395
>      Project: Jackrabbit
>         Type: Bug

>   Components: transactions
>     Reporter: Przemo Pakulski
>     Assignee: Tobias Bocanegra

>
> There is global static map in XASessionImpl class which stores all Xids and TransactionContexts
>     /**
>      * Global transactions
>      */
>     private static final Map txGlobal = new HashMap();
> It looks like this map is never cleared, even after end of transaction. It leads to memory leak because TransactionContexts and all nested objects (including XASessionImpl) are still referenced and couldn't be freed.
> Proposed solution : Is it posssible to add just single line which will remove TransactionContext from static map at the end of transaction ?
>       if (flags == TMSUCCESS || flags == TMFAIL) {
>             associate(null);
> -->       txGlobal.remove(xid);
>         } else  if (flags == TMSUSPEND) {
>             associate(null);
>         } else {
>             throw new XAException(XAException.XAER_INVAL);
>         }
> If this is not acceptable, then we have to unreference TransactionContext in another way.

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


[jira] Commented: (JCR-395) Using transactions leads to memory leak

Posted by "Dominique Pfister (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-395?page=comments#action_12374932 ] 

Dominique Pfister commented on JCR-395:
---------------------------------------

Fixed as suggested in revision 394937.

> Using transactions leads to memory leak
> ---------------------------------------
>
>          Key: JCR-395
>          URL: http://issues.apache.org/jira/browse/JCR-395
>      Project: Jackrabbit
>         Type: Bug

>   Components: transactions
>     Reporter: Przemo Pakulski
>     Assignee: Tobias Bocanegra
>      Fix For: 1.1

>
> There is global static map in XASessionImpl class which stores all Xids and TransactionContexts
>     /**
>      * Global transactions
>      */
>     private static final Map txGlobal = new HashMap();
> It looks like this map is never cleared, even after end of transaction. It leads to memory leak because TransactionContexts and all nested objects (including XASessionImpl) are still referenced and couldn't be freed.
> Proposed solution : Is it posssible to add just single line which will remove TransactionContext from static map at the end of transaction ?
>       if (flags == TMSUCCESS || flags == TMFAIL) {
>             associate(null);
> -->       txGlobal.remove(xid);
>         } else  if (flags == TMSUSPEND) {
>             associate(null);
>         } else {
>             throw new XAException(XAException.XAER_INVAL);
>         }
> If this is not acceptable, then we have to unreference TransactionContext in another way.

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


[jira] Commented: (JCR-395) Using transactions leads to memory leak

Posted by "Przemo Pakulski (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-395?page=comments#action_12374323 ] 

Przemo Pakulski commented on JCR-395:
-------------------------------------

After fix transactions doesn't work at all.

I'm not familiar with Jackrabbit code, but it looks that  'end' method is not good place to clear TransactionContext, because it is stil needed by 'commit/rollback' methods. Probably it should be done in 'commit/rollback' methods.


> Using transactions leads to memory leak
> ---------------------------------------
>
>          Key: JCR-395
>          URL: http://issues.apache.org/jira/browse/JCR-395
>      Project: Jackrabbit
>         Type: Bug

>   Components: transactions
>     Reporter: Przemo Pakulski
>     Assignee: Tobias Bocanegra
>      Fix For: 1.1

>
> There is global static map in XASessionImpl class which stores all Xids and TransactionContexts
>     /**
>      * Global transactions
>      */
>     private static final Map txGlobal = new HashMap();
> It looks like this map is never cleared, even after end of transaction. It leads to memory leak because TransactionContexts and all nested objects (including XASessionImpl) are still referenced and couldn't be freed.
> Proposed solution : Is it posssible to add just single line which will remove TransactionContext from static map at the end of transaction ?
>       if (flags == TMSUCCESS || flags == TMFAIL) {
>             associate(null);
> -->       txGlobal.remove(xid);
>         } else  if (flags == TMSUSPEND) {
>             associate(null);
>         } else {
>             throw new XAException(XAException.XAER_INVAL);
>         }
> If this is not acceptable, then we have to unreference TransactionContext in another way.

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


[jira] Resolved: (JCR-395) Using transactions leads to memory leak

Posted by "Tobias Bocanegra (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-395?page=all ]
     
Tobias Bocanegra resolved JCR-395:
----------------------------------

    Fix Version: 1.1
     Resolution: Fixed

fixed.

New Revision: 393452


> Using transactions leads to memory leak
> ---------------------------------------
>
>          Key: JCR-395
>          URL: http://issues.apache.org/jira/browse/JCR-395
>      Project: Jackrabbit
>         Type: Bug

>   Components: transactions
>     Reporter: Przemo Pakulski
>     Assignee: Tobias Bocanegra
>      Fix For: 1.1

>
> There is global static map in XASessionImpl class which stores all Xids and TransactionContexts
>     /**
>      * Global transactions
>      */
>     private static final Map txGlobal = new HashMap();
> It looks like this map is never cleared, even after end of transaction. It leads to memory leak because TransactionContexts and all nested objects (including XASessionImpl) are still referenced and couldn't be freed.
> Proposed solution : Is it posssible to add just single line which will remove TransactionContext from static map at the end of transaction ?
>       if (flags == TMSUCCESS || flags == TMFAIL) {
>             associate(null);
> -->       txGlobal.remove(xid);
>         } else  if (flags == TMSUSPEND) {
>             associate(null);
>         } else {
>             throw new XAException(XAException.XAER_INVAL);
>         }
> If this is not acceptable, then we have to unreference TransactionContext in another way.

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


[jira] Closed: (JCR-395) Using transactions leads to memory leak

Posted by "Tobias Bocanegra (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-395?page=all ]
     
Tobias Bocanegra closed JCR-395:
--------------------------------


> Using transactions leads to memory leak
> ---------------------------------------
>
>          Key: JCR-395
>          URL: http://issues.apache.org/jira/browse/JCR-395
>      Project: Jackrabbit
>         Type: Bug

>   Components: transactions
>     Reporter: Przemo Pakulski
>     Assignee: Tobias Bocanegra
>      Fix For: 1.1

>
> There is global static map in XASessionImpl class which stores all Xids and TransactionContexts
>     /**
>      * Global transactions
>      */
>     private static final Map txGlobal = new HashMap();
> It looks like this map is never cleared, even after end of transaction. It leads to memory leak because TransactionContexts and all nested objects (including XASessionImpl) are still referenced and couldn't be freed.
> Proposed solution : Is it posssible to add just single line which will remove TransactionContext from static map at the end of transaction ?
>       if (flags == TMSUCCESS || flags == TMFAIL) {
>             associate(null);
> -->       txGlobal.remove(xid);
>         } else  if (flags == TMSUSPEND) {
>             associate(null);
>         } else {
>             throw new XAException(XAException.XAER_INVAL);
>         }
> If this is not acceptable, then we have to unreference TransactionContext in another way.

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


[jira] Updated: (JCR-395) Using transactions leads to memory leak

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-395?page=all ]

Jukka Zitting updated JCR-395:
------------------------------

    Fix Version: 1.0.1
                     (was: 1.1)
        Version: 0.9
                 1.0

Merged for 1.0.1 in revision 409542.

> Using transactions leads to memory leak
> ---------------------------------------
>
>          Key: JCR-395
>          URL: http://issues.apache.org/jira/browse/JCR-395
>      Project: Jackrabbit
>         Type: Bug

>   Components: transactions
>     Versions: 1.0, 0.9
>     Reporter: Przemo Pakulski
>     Assignee: Tobias Bocanegra
>      Fix For: 1.0.1

>
> There is global static map in XASessionImpl class which stores all Xids and TransactionContexts
>     /**
>      * Global transactions
>      */
>     private static final Map txGlobal = new HashMap();
> It looks like this map is never cleared, even after end of transaction. It leads to memory leak because TransactionContexts and all nested objects (including XASessionImpl) are still referenced and couldn't be freed.
> Proposed solution : Is it posssible to add just single line which will remove TransactionContext from static map at the end of transaction ?
>       if (flags == TMSUCCESS || flags == TMFAIL) {
>             associate(null);
> -->       txGlobal.remove(xid);
>         } else  if (flags == TMSUSPEND) {
>             associate(null);
>         } else {
>             throw new XAException(XAException.XAER_INVAL);
>         }
> If this is not acceptable, then we have to unreference TransactionContext in another way.

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