&quot;Discardable memory&quot; doesn&#x27;t seem to be implemented though, however there is an implementation for &quot;discardable shared memory&quot; [1] which seems to offer this volatile behavior. It uses ashmem_pin_region() and ashmem_unpin_region() for Android, which seems to be the equivalent for iOS&#x27;s NSPurgeableData. I wonder if it does anything useful for any other OS.<p>[1] <a href="https:&#x2F;&#x2F;chromium.googlesource.com&#x2F;chromium&#x2F;src&#x2F;base&#x2F;+&#x2F;master&#x2F;memory&#x2F;discardable_shared_memory.cc" rel="nofollow">https:&#x2F;&#x2F;chromium.googlesource.com&#x2F;chromium&#x2F;src&#x2F;base&#x2F;+&#x2F;master...</a>