There has been some thoughts about implementing this for linux, but I don&#x27;t think it got very far. The idea is that you mark a range of memory as &quot;volatile&quot;, and the OS will free that when it&#x27;s running low on memory. In most cases where you&#x27;re running out of memory though, swapping out pages or killing a program using the memory is probably the right thing to do though.<p><a href="https:&#x2F;&#x2F;lwn.net&#x2F;Articles&#x2F;522135&#x2F;" rel="nofollow">https:&#x2F;&#x2F;lwn.net&#x2F;Articles&#x2F;522135&#x2F;</a>