2 ms·
Of course you can only return pages at a time. That is the minimum size virtual memory works in. You don't want malloc to instantly release memory to the syste
by olliej 4y ago
Of course you can only return pages at a time. That is the minimum size virtual memory works in.
You don't want malloc to instantly release memory to the system on free(), and malloc() is then constrained by the same page multiple at a time restriction as anything else so it can't release fragmented memory.
What you should be doing is trying to save state so that you can return to original state, not fighting to keep going.