this is the first time I encounter a swap issue, I'm lost about how Linux is supposed to behave. I have a RHEL virtual machine running a batch processing RAM intensive application (100+GB RAM, 1GB swap, swappiness to 1). After restarting the VM, batchs after batchs (that each uses 70% of RAM and ends successfully), the swap slowly rises up to 100%. When looking at running process, none of them are using any swap.
From what I've read, Linux swaps pages to the swap space when reaching max RAM usage or when too many process are using the RAM (so it swaps unused pages to give more room to frequently used pages). Those pages are only swapped back to RAM when needed by the process. Because no running process uses swap, it looks like all my swap pages are ... orphans ? And because no process is asking for those pages, Linux has no reason to waste resources swapping back those pages to RAM ? But then I dont understand when the swap is going to be freed ? Does Linux tags those pages as "orphans" and overwrite them when swap is needed, despite showing me 100% usage ? Or is the swap really considered "full" and I am doomed to add a swap off / swap on cron to reset the swap after my batchs ?