Both OS X and iOS have the NSPurgeableData class which implements something like this: <a href="https:&#x2F;&#x2F;developer.apple.com&#x2F;library&#x2F;mac&#x2F;documentation&#x2F;Performance&#x2F;Conceptual&#x2F;ManagingMemory&#x2F;Articles&#x2F;CachingandPurgeableMemory.html" rel="nofollow">https:&#x2F;&#x2F;developer.apple.com&#x2F;library&#x2F;mac&#x2F;documentation&#x2F;Perfor...</a><p>Edit: Chromium has this: <a href="https:&#x2F;&#x2F;chromium.googlesource.com&#x2F;chromium&#x2F;src&#x2F;base&#x2F;+&#x2F;master&#x2F;memory&#x2F;discardable_memory.h" rel="nofollow">https:&#x2F;&#x2F;chromium.googlesource.com&#x2F;chromium&#x2F;src&#x2F;base&#x2F;+&#x2F;master...</a>