TECHNOLOGY

Measure disk usage retained by an unlinked open model artifact

In this article
THE QUICK TAKE

Measure retained file identity and allocation separately from pathname totals before planning space recovery from unlinked artifacts.

An obsolete model artifact is removed from its directory, but filesystem free space barely changes. Removing a name does not necessarily end the file object’s lifetime. A process can retain an open reference, so a pathname-based directory total and filesystem allocation can legitimately diverge until the last relevant reference ends.

Compare the same filesystem

Record the mount, storage layer and observation time for both the directory measurement and free-space result. A container’s path and a host filesystem can describe different layers. Do not begin by assuming every discrepancy is an unlinked file. Other allocations, metadata and measurement scope can contribute, so preserve the actual boundary being compared.

Identify retained objects

Through authorized process descriptor metadata, look for the affected artifact identity and deleted-name indications. Associate each reference with its owning process and instance. A descriptive pathname is useful but not sufficient: compare device and inode where available. Multiple descriptors or workers can refer to one object, so a raw descriptor count is not a count of independently allocated artifact copies.

Separate apparent size and blocks

The stat interface distinguishes logical file length from allocated-block observations. Sparse files and filesystem-specific allocation behavior make these different quantities. Do not sum apparent lengths and promise that amount of free space will return. Likewise, shared storage arrangements can make unique reclaimable space more complex than a per-file block figure. State the accounting assumption and its limits.

Preserve the consumer lifecycle

Unlink documents retention while an object remains open. The correct owner can release the reference through its normal unload or process lifecycle. Do not truncate a live file through a process descriptor to force space recovery; that changes the consumer’s backing object and can damage ongoing work. First establish whether the supposedly obsolete artifact is still serving an intended old revision.

Verify final release with synthetic data

In an isolated filesystem fixture, hold a harmless file open, remove its last name and compare directory visibility with allocation before closing the final reference. Observe actual reclaimed space rather than predicting it solely from file length. Acceptance explains the retention mechanism. It does not establish every filesystem discrepancy, authorize stopping live model workers or prove that deleting another pathname removes the same underlying object.

Primary references

Linux Unlinked File Lifetime.

Process File Descriptors.

Linux File Size and Allocated Blocks.

Related reading: OS page cache and cold model loading: what to record; Read-only container will not start: where to allow temporary and cache writes.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles