OSX - memory allocation - Free vs Inactive memory
I have an application that creates loads of objects and releases them again fairly quickly.
All of this memory seems to end up in OSX’s “inactive memory” pool while new allocations are being eaten from the “free memory” pool.
According to apple this is normal and inactive memory is supposed to be reclaimed as free. ( http://support.apple.com/kb/HT1342 )
This however doesn’t seem to be happening and though my application never uses more then say 50MB of real memory, it eats through GB’s of memory on the way that ends up as inactive. When OS reaches some low free number ( say 50MB free memory ) it starts paging and everything slows to a crawl. My application is still not using more then 50 MB…
This is clearly an OSX issue ( at least it seems that way ), but is there any way i could allocate more smartly. For instance start by allocating a large region and then just use that memory? Would i have to write a custom malloc implementation to stick between Qt and OSX?