Why doesn't deleting messages immediately free up disk space?

When you delete messages from mailboxes or rooms, you may notice that the operating system does not immediately report an increase in free disk space. This is normal and intentional behavior designed to maximize performance and prevent storage fragmentation.

There are two primary reasons for this:

1. Deferred Purging

To keep user interaction fast and responsive, Citadel defers intensive cleanup tasks. When a user deletes a message, Citadel hides it from view immediately, while the underlying database records are cleaned up by automated maintenance jobs that run nightly.

2. Database Storage Reuse

High-performance database engines do not continuously shrink and expand files on disk. Constantly reallocating disk blocks introduces heavy filesystem fragmentation and unnecessary disk I/O.

Instead, when data is deleted, the database engine retains those storage pages in an internal free list. When new incoming messages, calendar events, or attachments arrive, Citadel automatically reuses that freed space first. Your database files will stabilize in size and avoid further growth until newly added data exceeds the reclaimed capacity.