Hacker News new | ask | show | jobs
by anders0 4980 days ago
But couldn't the language's runtime (or the GC library, or whatever) register for these notifications?
1 comments

Yes, but my impression is that the set of conditions where this helps (you have memory pressure AND the runtime has lots of memory it can free up) is rather rare. If you have memory pressure, that's usually the same time that the runtime is actually trying to make use of lots of memory.

IIRC, Android provides something along these lines (as does Windows Phone 7.1), and when you get under memory pressure (common on Honeycomb-based tablets) you end up with thousands of these notifications, each freeing up 1KB or 2KB when you really need to free up tens of megabytes (which you can only do by serializing and terminating an application).