I've got some data I'm caching in the storage heap, and right now I'm using a fixed-size cache. It works well enough, but I'd love to improve it by using whatever amount of space is actually available.
I could certainly do this by doing MemHeapFreeBytes() when I start caching things and then set my fixed size to be some percentage of what's available, but that's not totally free of problems (since I am making a guess at the memory requirements of other parts of the software) and also it doesn't really give me the best performance.
So, is there some mechanism where the OS can notify me when memory is getting too low so that I can free up some of my stuff? In theory I could probably away with something like this by replacing system calls, but that gets ugly and possibly unsafe really quickly.
Of course, I could just poll with MemHeapFreeBytes() once a second or something and always try to keep at least a certain amount of memory free, but even that doesn't guarantee that I'll avoid problems.
- Logan
To unsubscribe send an email to [EMAIL PROTECTED] -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
