Best way to reclaim disk space when using ATLAS M40

In an ATLAS replica set environment (M40), what is the best way to reclaim disk space (compact storage) for large documents that have been removed from GridFS?

Hi Chris,

As a collection namespace is continuously re-used the WiredTiger storage engine will naturally re-claim that space over time. If you’d like to more pro-actively explore options feel free to contact MongoDB support,


1 Like

Hi @Andrew_Davidson,

Thanks for the reply.

Just to clarify, we’re working with some large amounts of data that get stored in grid.fs for a short period of time - up to about a day before being deleted. Using Atlas is relatively new to us, our experience of using a simple non-replicated Mongo install, was that we had to pro-actively reclaim the disk space used by the grid.fs data after it had been deleted. The disk space was not automatically reclaimed by the operating system.

By using Atlas (M10 or above) is the space from deleted grid.fs documents automatically released. This is pertinent in terms of our Atlas costs, if we have a cluster with 30GB of storage for instance, over-time is this going to get exhausted from the space assigned to grid.fs documents, that have been subsequently deleted, not getting freed up automatically.


The data will be reclaimed automatically as long as you’re using the same collections for the gridFS environment over time. Separately, if you need to proactively free space you should be able to use

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.