This control is used to define how aggressive the kernel will swap memory pages. Higher values will increase aggressiveness, lower values decrease the amount of swap. A value of 0 instructs the kernel not to initiate swap until the amount of free and file-backed pages is less than the high water mark in a zone.

-- linux-5.0/Documentation/sysctl/vm.txt


An estimate of how much memory is available for starting new applications, without swapping. Calculated from MemFree, SReclaimable, the size of the file LRU lists, and the low watermarks in each zone. The estimate takes into account that the system needs some page cache to function well, and that not all reclaimable slab will be reclaimable, due to items being in use. The impact of those factors will vary from system to system.

-- linux-5.0/Documentation/filesystems/proc.txt (file /proc/meminfo).

What are the current values of the low and high watermarks on my system? And what value are they relative to, e.g. if I want to express them as a percentage?


The watermarks are the low and high values in /proc/zoneinfo, shown in units of pages (4096 bytes on x86).

On my 8GB system, most of the pages are split between the DMA32 zone and the Normal zone. (And everything belongs to Node 0, because it is not a NUMA system).

# cat /proc/zoneinfo
Node 0, zone      DMA
  pages free     3961
        min      33
        low      41
        high     49
        spanned  4095
        present  3996
        managed  3961
Node 0, zone    DMA32
  pages free     139960
        min      7184
        low      8980
        high     10776
        spanned  1044480
        present  888973
        managed  866327
Node 0, zone   Normal
  pages free     33907
        min      31449
        low      33868
        high     36287
        spanned  1173504
        present  1173504
        managed  1140349

I expect the watermarks are a proportion of managed. Very broadly speaking, the watermarks on my system are somewhere between 1% and 3%. Or if you are thinking in terms of the "high-watermark" metaphor, they are between 97% and 99% :-).

(The Linux low watermark does NOT correspond to a metaphorical "low watermark"; the low and high values are both thresholds in the same direction, they are just used for slightly different purposes).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.