javajcrjackrabbit-oak

Jackrabbit oak remove node doesn't freed disk space


So when I try to remove node it doesn't remove file from disk. Only node is removed. There is example of code what I do:

Node node = session.getNodeByIdentifier(uuid);
node.remove();

I read that garbage collector must be invoked to remove file from disk. I can't find how to do that.


Solution

  • It depends on the type of store.

    For the DocumentNodeStore (Mongo, RDB), see http://jackrabbit.apache.org/oak/docs/nodestore/documentmk.html#revision-gc.

    For Segment store, see http://jackrabbit.apache.org/oak/docs/nodestore/segment/overview.html#garbage-collection.