You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Reto Bachmann-Gmür (JIRA)" <ji...@apache.org> on 2010/04/14 20:08:50 UTC

[jira] Created: (FELIX-2283) platform security: m_permissions memory leak

platform security: m_permissions memory leak
--------------------------------------------

                 Key: FELIX-2283
                 URL: https://issues.apache.org/jira/browse/FELIX-2283
             Project: Felix
          Issue Type: Bug
          Components: Framework Security
    Affects Versions: framework.security-1.0.0
            Reporter: Reto Bachmann-Gmür


Constant growth of memory using platform security 1.0.0 results in heap overflow as memory usage incerases with permission checks.


Having a look at it I found two problems, for which I can submit a patch:
- a value from m_permissions is never retrieved, as the PemissionsInfo Array is never equals to an existing key
Solution: invoke get with an instance of Entry, change Entry.equals to check for deep equality of array-entries
- as the Persmissions instance kept as (non-weak) reference in the m_permissions values references the PermissionInfo[] key-entry, none of them can be garbage collected. As a result the size of m_permissions constantly grows

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

       

[jira] Updated: (FELIX-2283) platform security: m_permissions memory leak

Posted by "Reto Bachmann-Gmür (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2283?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Reto Bachmann-Gmür updated FELIX-2283:
--------------------------------------

    Attachment: Permissions.java.patch

Patch fixing the issue described, massive decreasing the derivative of the memory consumption.

> platform security: m_permissions memory leak
> --------------------------------------------
>
>                 Key: FELIX-2283
>                 URL: https://issues.apache.org/jira/browse/FELIX-2283
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework Security
>    Affects Versions: framework.security-1.0.0
>            Reporter: Reto Bachmann-Gmür
>         Attachments: Permissions.java.patch
>
>
> Constant growth of memory using platform security 1.0.0 results in heap overflow as memory usage incerases with permission checks.
> Having a look at it I found two problems, for which I can submit a patch:
> - a value from m_permissions is never retrieved, as the PemissionsInfo Array is never equals to an existing key
> Solution: invoke get with an instance of Entry, change Entry.equals to check for deep equality of array-entries
> - as the Persmissions instance kept as (non-weak) reference in the m_permissions values references the PermissionInfo[] key-entry, none of them can be garbage collected. As a result the size of m_permissions constantly grows

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

       

[jira] Resolved: (FELIX-2283) platform security: m_permissions memory leak

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

Karl Pauls resolved FELIX-2283.
-------------------------------

    Resolution: Fixed

I just committed a modified version of your patch (mostly using Arrays.equals instead of Arrays.deepEquals as the security provider targets 1.3). I pushed a new 1.1.0-SNAPSHOT. Please test it and close this issue if it works for you. Thanks a lot!

> platform security: m_permissions memory leak
> --------------------------------------------
>
>                 Key: FELIX-2283
>                 URL: https://issues.apache.org/jira/browse/FELIX-2283
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework Security
>    Affects Versions: framework.security-1.0.0
>            Reporter: Reto Bachmann-Gmür
>         Attachments: Permissions.java.patch
>
>
> Constant growth of memory using platform security 1.0.0 results in heap overflow as memory usage incerases with permission checks.
> Having a look at it I found two problems, for which I can submit a patch:
> - a value from m_permissions is never retrieved, as the PemissionsInfo Array is never equals to an existing key
> Solution: invoke get with an instance of Entry, change Entry.equals to check for deep equality of array-entries
> - as the Persmissions instance kept as (non-weak) reference in the m_permissions values references the PermissionInfo[] key-entry, none of them can be garbage collected. As a result the size of m_permissions constantly grows

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