What's all this uncommitted, reserved memory in my process?

后端 未结 3 1639
故里飘歌
故里飘歌 2020-12-11 05:27

I\'m using VMMap from SysInternals to look at memory allocated by my Win32 C++ process on WinXP, and I see a bunch of allocations where portions of the allocated memory are

3条回答
  •  离开以前
    2020-12-11 05:46

    Whenever a thread is created in your application a certain (configurable) amount of memory will be reserved in the address space for the call stack of the thread. There's no need to commit all the reserved memory unless your thread is actually going to need all of that memory. So only a portion needs to be committed.

    If more than the committed amount of memory is required, it will be possible to obtain more system memory.

    The practical consideration is that the reserved memory is a hard limit on the stack size that reduces address space available to the application. However, by only committing a portion of the reserve, we don't have to consume the same amount of memory from the system until needed.

    Therefore it is possible for each thread to have a portion of reserved uncommitted memory. I'm unsure what the page type will be in those cases.

提交回复
热议问题