dmarti/memory-hog — pull request #7 by raphaelsc (2014-06-05 19:39:31+00:00)
Title: Show hard parameter use case

watermark_lo is the watermark used to determine memory pressure.
When reclaimer thread wakes up to reclaim memory, then we could say that:
If free memory is greater or equal than watermark_lo, there is soft pressure.
Otherwise, there is hard pressure.

watermark_lo is used as a base to calculate target.
As registered shrinkers can definitely be called at soft pressure, target
cannot be calculated, thus zero.

So in soft pressure, target and hard == 0.
In hard pressure, target and hard are set to the requested memory and 1,
respectively.

That being said, either target or hard parameters from the registered shrinker
procedure could be used to detect soft pressure and hard pressure.

Handling soft pressure:
Application is free to decide what to do, release a bit of memory and return,
or simply do nothing and return.