Reducing the size of your AEM instance

By default, AEM uses Tar files to store the nodes and binaries of the application. One characteristic of using Tar files for storage is that the changes are never overwritten even if we are only updating data, which continually increases disk space usage.
AEM uses a mechanism called Revision Cleanup to remove unused data from the repository and reclaim disk space.

Performing an Offline Revision Cleanup

Adobe provides a tool called Oak-run that performs an offline cleanup revision. The Offline term means that the AEM instance should be stopped for the cleanup process to work.

Downloading the correct Oak-run version:

  1. Shut down the AEM instance
  2. Go to /system/console/bundles (e.g. http://localhost:4502/system/console/bundles) and look for “Oak Core” to check the Oak version.
  3. Go to and look for the Oak-run version that matches the “Oak Core” version (e.g. if the Oak Core version is 1.2.2)

Deleting unreferenced checkpoints (optional):

Optionally, before running the cleanup process, you can use the tool for deleting unreferenced checkpoints. To do that:

  1. Run: java -jar oak-run.jar checkpoints install-folder/crx-quickstart/repository/segmentstore to find the checkpoints
  2. Then, to delete them run java -jar oak-run.jar checkpoints install-folder/crx-quickstart/repository/segmentstore rm-unreferenced

Running the cleanup process:

Enter the folder where you downloaded the jar file and run the command as follows: java -jar oak-run.jar compact /route/to/aem/crx-quickstart/repository/segmentstore. Notice that oak-run.jar should be replaced with the jar version you downloaded, e.g., oak-run-1.2.2.jar, and /route/to/aem/ should be replaced by the path to the crx-quickstart folder.

After the process finishes , you will notice that the size of your AEM instance has been significantly reduced.

Thanks for reading, if you want to know more about Magmalabs, contact us here!

Best Practices
De Código, Café y Cervezas 10 – Technical Debt
Importing fonts the right way
De Código, Café y Cervezas 09 – ¡Hola Mundo!