-
1. Re: Database binary storage space leak?
hchiorean Mar 6, 2017 7:40 AM (in response to zcc39r)Binary storage and repository storage are independent of each other.
The data from the binary store (i.e. binary values) is *eventually reclaimed* by a GC thread. The ModeShape documentation (Binary values - ModeShape 5 - Project Documentation Editor explains this.
-
2. Re: Database binary storage space leak?
zcc39r Mar 7, 2017 2:58 AM (in response to hchiorean)The ModeShape documentation (Binary values) explains this.
The repository periodically runs a multi-phase garbage collection process to identify those binaries that are no longer referenced by repository content. When such binaries are discovered, the repository calls the BinaryStore's markAsUnused(...) method.
What is the algorithm of such a discovery? I can see that removeValuesUnusedLongerThan() is called periodically, but not markAsUnused().
-
3. Re: Database binary storage space leak?
hchiorean Mar 7, 2017 6:43 AM (in response to zcc39r)Binaries are marked as used and unused via *a* transaction synchronizer - modeshape/WritableSessionCache.java at master · ModeShape/modeshape · GitHub
That logic of detecting which binaries are used or not takes places during #session.save() but the actual changes are persisted only if a transaction is committed. ModeShape uses internally 1 synchronizer per transaction, but that synchronizer contains multiple "functions" (in a list) because the order of operations is important.
-
4. Re: Database binary storage space leak?
zcc39r Mar 7, 2017 8:23 AM (in response to hchiorean)Thank you, Horia, for explanation!
So, I guess, the wording mentioned above should be changed slightly in documentation since there is no periodically running unused binary discovery phase. And periodically running GC process is single-phased.