Note: Based on observations and tests made on Solaris OS 10 with Solaris compilers.
When you call free() or delete(), it will NOT really release any memory back to OS. Instead, that memory is kept with the same process until it is terminated. However, this memory can be reused for any future allocations by the same process.
This ‘freed’ memory is never released to OS, even when the system is out of memory and other processes need memory. That means, a process is stuck with the largest level of memory allocation throughout its life time.
This is big concern for most processes that are expected to run (literally) forever without a restart.
There is an alternative, by linking to mapmalloc library, that uses map/unmap instead of sbrk for memory allocation. When linked with this library, memory could be really released to operating system when free/delete is called. However, memory allocation could be potentially 5 times slower. One heck of a trade off!
Hope this information will help in your designs.
This is yet another example of NDTV.com’s sensationalism twisted titles. The title says, as if this was a fact, woman made to urinate in pub...
When you are writing software, you always get a second chance. In fact, lots of chances to get it correct. You have compiler warnings, fail...
WWDC 2011 Session Videos are now available for all, for Free.
I have recently spotted quite a few places where NDTV title doesn’t exactly say the same as the details in the article says. Lost in transla...