Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-2023

WorkspaceInfo.dispose() does not deregister SharedItemStateManager from virtual item state providers

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.3
    • Fix Version/s: 1.5.4
    • Component/s: jackrabbit-core
    • Labels:
      None

      Description

      Automatic disposal of idle workspaces frees unused workspaces but corresponding SharedItemStateManager (and releated PersistenceManager) is still kept in memory referenced by virtual item state providers, this can lead to memory leaks.

      1. JCR-2023.txt
        0.8 kB
        Przemo Pakulski

        Activity

        Hide
        ppakulski Przemo Pakulski added a comment -

        During initialization of workspace SharedItemStateManager is registeres as listener fro virtual item state providers, by the following code :

        // create item state manager
        try {
        itemStateMgr = createItemStateManager(persistMgr, rootNodeId,
        ntReg, true, cacheFactory, ismLocking);
        try

        { itemStateMgr.addVirtualItemStateProvider( vMgr.getVirtualItemStateProvider()); itemStateMgr.addVirtualItemStateProvider( virtNTMgr.getVirtualItemStateProvider()); }

        catch (Exception e)

        { log.error("Unable to add vmgr: " + e.toString(), e); }

        When workspace is disposed SharedItemStateManager should be deregistered from virtual item state providers to aloow JVM to free memory.

        Show
        ppakulski Przemo Pakulski added a comment - During initialization of workspace SharedItemStateManager is registeres as listener fro virtual item state providers, by the following code : // create item state manager try { itemStateMgr = createItemStateManager(persistMgr, rootNodeId, ntReg, true, cacheFactory, ismLocking); try { itemStateMgr.addVirtualItemStateProvider( vMgr.getVirtualItemStateProvider()); itemStateMgr.addVirtualItemStateProvider( virtNTMgr.getVirtualItemStateProvider()); } catch (Exception e) { log.error("Unable to add vmgr: " + e.toString(), e); } When workspace is disposed SharedItemStateManager should be deregistered from virtual item state providers to aloow JVM to free memory.
        Hide
        ppakulski Przemo Pakulski added a comment -

        Attached patch which updates dispose() method of SharedItemStateManager and deregister it from virtual item state providers.

        Show
        ppakulski Przemo Pakulski added a comment - Attached patch which updates dispose() method of SharedItemStateManager and deregister it from virtual item state providers.
        Hide
        jukkaz Jukka Zitting added a comment -

        Good point. I applied the patch in revision 760386 and merged it to the 1.5 branch in revision 760413.

        Show
        jukkaz Jukka Zitting added a comment - Good point. I applied the patch in revision 760386 and merged it to the 1.5 branch in revision 760413.

          People

          • Assignee:
            ppakulski Przemo Pakulski
            Reporter:
            ppakulski Przemo Pakulski
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development