S
S S
Hi
I am facing one problem while using my malloc(), I allocate 2GB
upfront in chunks of 4K using malloc. And then I free it immediately
assuming that free will not return back this memory to the system but
will keep it for future malloc use. But strangely, when I free it, I
see process size drastically goes down, meaning all memory has been
returned back to the system ?
I think malloc is also a memory manager which should keep all memory
with itself and should not return back to the system ? Am I not using
malloc the way it should be ?
Please help.
Thanks
SS
I am facing one problem while using my malloc(), I allocate 2GB
upfront in chunks of 4K using malloc. And then I free it immediately
assuming that free will not return back this memory to the system but
will keep it for future malloc use. But strangely, when I free it, I
see process size drastically goes down, meaning all memory has been
returned back to the system ?
I think malloc is also a memory manager which should keep all memory
with itself and should not return back to the system ? Am I not using
malloc the way it should be ?
Please help.
Thanks
SS