Nuxeo Server

Garbage-Collecting Orphaned Binaries

The binary files attached to documents are not stored in the database but using a specialized binary store (typically filesystem-based or S3), and are not removed like documents (see Deleting Documents).

Binary files are not immediately deleted when their containing document is deleted because the binary store uses a de-duplication strategy which means that the same binary file may be referenced by several documents. To avoid complex locking or reference counting strategies, they are simply garbage-collected when there remains no reference to them (they are orphaned).

Usage with the Nuxeo Shell or Java Code

import org.nuxeo.ecm.core.blob.DocumentBlobManager;
import org.nuxeo.ecm.core.blob.binary.BinaryManagerStatus;

DocumentBlobManager docBlobManager = Framework.getService(DocumentBlobManager.class);
if (!docBlobManager.isBinariesGarbageCollectionInProgress()) {
    BinaryManagerStatus binaryManagerStatus = docBlobManager.garbageCollectBinaries(true);
    println("Orphaned binaries garbage collecting result: " + binaryManagerStatus);
} else {
    println("Orphaned binaries garbage collecting is already in progress.");

Related Documentation
a month ago manonlumeau NXDOC-1453: Review garbage-collecting orphaned binaries page
a month ago manonlumeau Final review
a month ago manonlumeau Update page to reflect JSF UI deprecation
3 years ago Manon Lumeau 6
3 years ago Manon Lumeau 5
3 years ago Solen Guitter 4
4 years ago Solen Guitter 3 | Fix broken anchors
4 years ago Julien Carsique 2
4 years ago Solen Guitter 1
History: Created by Solen Guitter

We'd love to hear your thoughts!

All fields required