We noticed that on some servers the reported swap usage was very high. After investigating, it appeared that this was not active swap usage, but old swap memory that was still marked as used.
When we ran swapoff followed by swapon , the swap usage immediately dropped back to 0%. Before that, it showed values like 60% or even 99%.
This raised the question whether Cleavr’s nightly jobs (or other automated maintenance tasks) are able to clear or reset old swap usage automatically.
We are not swap experts, so please let us know if our assumption about “old” swap memory is incorrect, or if there is a recommended approach within Cleavr to handle this.
I think what you are observing is actually normal Linux behavior rather than an issue.
On Linux, swap is used as a pressure relief mechanism. When the system experiences memory pressure at some point, certain memory pages are moved to swap.
Once the pressure is gone, Linux does not automatically move those pages back into RAM unless they are accessed again. As a result, swap can remain marked as “used” indefinitely, even if there is plenty of free memory and no active swapping happening.
Regarding Cleavr specifically, Cleavr’s nightly jobs or maintenance tasks do not clear or reset swap, and this is intentional.
Automatically toggling swap is not generally recommended on Linux systems. Because of that, Cleavr follows standard Linux behavior and leaves swap management to the operating system.
In practice, high swap usage by itself is not a problem. What matters more is whether the system is actively swapping, for example continuous swap-in or swap-out activity, high disk IO, or noticeable performance degradation. If those are not present, then the system is behaving as expected.
I hope this answers your question. Please let us know if you have any other questions or concerns.
Yeah, this is a perfectly normal thing for Linux to do. Swap doesn’t clear itself unless the memory that was swapped out is used again. There is old memory marked as moved but not being used, so it’s just in a “holdover” state. It cleared that state when you ran swapoff and swapon, which is why the usage dropped to 0%.
As Anish said, Cleavr is designed so that it doesn’t touch swap handling. By default, Linux doesn’t do much with swap. It’s more about memory load, and the OS decides when to bring things back into RAM or leave them in swap if they’re not being used. I wouldn’t worry about it if you’re not seeing drops in performance.
If swap is always full or you’re having speed problems, you should look into it more. Other than that, it’s just Linux being Linux. Watch how much swap is being used, but as long as there isn’t any real-time changing, it shouldn’t be a problem.