-
1. Re: Memory footprint of long-running session
hchiorean Mar 15, 2017 5:28 AM (in response to zcc39r)If this long lived session never loaded / had anything to do with the nodes created by the other sessions, it shouldn't be keeping any references (i.e. acting as a GC root). Only after a session accesses a node will that node (and whatever lies beneath) become strongly referenced by that session.
So it would help if you investigate the GC roots in your case and check where the unclean references come from. In general, once a short lived session is logged out (session.logout) it is removed from the repository Map which holds active sessions and therefore it should become eligible for GC.
-
2. Re: Memory footprint of long-running session
zcc39r Mar 15, 2017 5:35 AM (in response to hchiorean)become strongly referenced by that session
Does it mean that weak references can exist too?
Most memory hungry objects of ModeShape I can see are instances of org.modeshape.schematic.internal.document.BasicDocument. And GC root as far as I understand is observation session. After closing this session and performing GC the number of the objects mentioned above reduces dramatically. Will it be helpful if I provide you with the heap dump?
-
3. Re: Memory footprint of long-running session
hchiorean Mar 15, 2017 6:06 AM (in response to zcc39r)Does it mean that weak references can exist too?
There are a variety of inter-object references which are stored by ModeShape, both weak and strong. From a GC perspective, only the strong ones are relevant. From the perspective of a potential memory leak, it's important that once a session is logged out all referenced objects together with that session can be GCed.
Are you using by any change a custom workspaceCache size ? (default is 10k). The workspace cache is the other place which stores in-memory data shared by sessions and which is not cleared unless a WS is deleted or the repository shut down.
Feel free to attach the heap dump and once I get the chance, I'll look at it.
-
4. Re: Memory footprint of long-running session
sivaa Dec 4, 2017 11:55 PM (in response to hchiorean)If the default workspaceCache is 10k , does it mean Modeshape still holds these in-memory references object shared shared by the sessions. Is it a memory leak inside Modeshape?