3 ms·
> The problem here is that once it is used once it is never freed. (Other than being swapped out). So you effectively cache all of the space your program needs
by Pxtl 5y ago
> The problem here is that once it is used once it is never freed. (Other than being swapped out). So you effectively cache all of the space your program needs forever.
What do you mean? It will get freed once you pop that stack-frame won't it?
- marcosdumay 5y agoNo. It was never allocated either. It was virtual memory before it was used, but once you use it, it's mapped into physical memory and marked as dirty. So it may be swapped out or live there, those are the only two options. It would take your OS being fully aware of your usage schema for it to be able to free the memory.