Memory plugging
These tests are aimed at providing the managed system with exactly the amount of memory required for an optimal system performance, thereby minimizing the system's memory usage.
The critical task is to detect that the system needs additional memory before the performance degrades too much, but not too early to limit the possible impact of memory overcommitment.
When an application requests additional storage, Linux™ memory management works as follows:
- If there are sufficient free pages, the request is served with no further actions.
- If that causes the amount of free memory to fall below a high water mark, an asynchronous page scan by kswapd is triggered in the background.
- If serving the request would cause the amount of free memory to fall below a low water mark, a so called direct scan is triggered, and the application waits until this scan provides the required pages.
- Depending on various other indicators the system may decide to mark anonymous pages (pages that are not related with files on disks) for swapping and initiate that these pages be written to swap asynchronously. After a memory page is backed up to disk it can be removed from memory. If it needs to be accessed later, it is retrieved from disk
From this, we conclude the following:
- The occurrence of page scans is a clear but soft indicator of memory pressure.
- The occurrence of direct page scans is an indicator of a serious lack of free memory pages likely to impact system performance, because applications are waiting for memory pages to free up.
- The amount of pages freed during the scans is reported as steal rate. The best case is a steal rate identical to the page scan rate, which would mean that each scanned page turns out to be a freeable page.
- The exact role of swapping with regard to the level of memory pressure is not clear at the moment, and it is therefore not considered in our test.