<snip>awesome</snip>
This basically. Never work on the basis that the memory you explicitly allocate yourself is the only memory used by your program, because it's not. Any API call you make, or any call into any external library, will very probably be doing it's own memory allocations, as well as fixed overhead from bringing up the program under the OS (heap space, stack space, program loader, all kinds of mysterious gubbins). None of this is under your control - it's like being a guest in somebody's house and finding that the fridge is empty. You've only been eating a small amount so far asyou know, certainly not enough to empty the fridge, but your hosts have also been eating.