Why a Reused Dataset Can Get Slower After Another App Starts Working

Linux can turn file cache from a fast path into reclaimable memory when RAM gets tight. That means a workload that looked stable can suddenly reread the same files from storage again after another app starts using memory.

A dark painted server room with glowing racks, a central cabinet of green-lit modules, and a stream of luminous data tiles flowing toward two hardware boxes.
Data cache drains under pressure.

A reused dataset is usually fast because Linux keeps recently read file data in the page cache, so later reads can avoid hitting storage again. But that speedup is not guaranteed to stay in place. Page cache is reclaimable, which means the system may free it when memory pressure rises, even if the files themselves have not changed.

Why the same files can become slower later

The key idea is that the cache is a convenience, not a promise. If another application starts using a lot of RAM, Linux may decide that some cached file pages are better used for something else. When that happens, the next read of the same files may need to fetch data from the backing storage again instead of reusing RAM-resident copies.

What happens when memory pressure rises

Linux does not wait for one dramatic failure before acting. As free memory falls, it can start reclaiming pages asynchronously. If memory becomes tighter still, allocations can trigger direct reclaim, which stalls the requesting work until enough pages are freed. That is why an unrelated app can indirectly make a previously warm dataset feel colder.

Dirty cache is different from clean cache

Not every cached page is discarded the same way. If Linux wants to reuse dirty page cache pages for other purposes, it first synchronizes the file contents back to the device. That protects the file state, but it also means reclaim can carry extra work before memory is made available again.

Worked example of the slowdown

Hypothetical example: a photo editor opens a 2 GB project and closes it, leaving many file tiles in cache. A few minutes later, a browser starts building a large video call cache and a compiler begins work. If those new tasks push memory pressure high enough, Linux may reclaim some of the photo pages first. Reopening the project then forces the SSD to read those tiles again, even though the storage stack did not change and the project files are still the same. The slowdown comes from the cache being reused for something else, not from the dataset itself changing.

What this means in practice

  • A fast reread can become slow if page cache entries were reclaimed.
  • The trigger may be an unrelated memory-hungry app, not the storage device.
  • A file can stay unchanged and still need new storage reads after pressure clears.
  • Dirty cached data is written back before Linux reuses those pages.

The practical takeaway is simple: if a workload depends on rereading the same files, its speed can depend on how much spare memory is available, not just on the SSD or filesystem. The cache helps when RAM is plentiful, then quietly stops helping when other work needs that RAM more.

Your reaction

Loading reactions…

Comments 0

Be respectful. No links or promotions. Comments appear after review.

Keep reading