07-25-2009 05:29 AM
The Memory API documentation is sketchy, and the information the API is reporting doesn't add up. I'd appreciate assistance, thank you!
The real problem I'm running up against over and over, is that in the API documentation the description of an item is too often just the item name restated in a short sentence with no additional meaning, or as in this case insufficient explanation.
Here's what I'm seeing from the following memory stat calls:
So, allocated + free is more than the total. Now, turning to API reference to figure out what this might mean:
public static int getFlashTotal() - Bytes of flash needed by the VM.
Needed by the VM for what, and when? The most the VM will ever need, what it needs right now but doesn't have, what it needs right now and has got, or something else?
public static int getMemoryNeeded() - Bytes of flash the VM wants to recover.
When, and from what? Why does the VM want to do this but hasn't done it yet, what's stopping it? Is it in progress or is it stuck pending something? And where will that recovered memory go, back into the free pool or is it already reserved for a pending allocation request? Why does the VM want to recover it, to free it up or to use it now?
It's really sad how sketchy the API documentation is, I'm sorry to say it but it's true. It's slowing us down while the iPhone gets ahead. We do want to compete with the iPhone, right? Then we need better docs, please.