Jackrabbit Content Repository
  1. Jackrabbit Content Repository
  2. JCR-2023

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major 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
        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
        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
        Przemo Pakulski added a comment -

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

        Show
        Przemo Pakulski added a comment - Attached patch which updates dispose() method of SharedItemStateManager and deregister it from virtual item state providers.
        Hide
        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
        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:
            Przemo Pakulski
            Reporter:
            Przemo Pakulski
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development