Category Archives: Windows Memory Management

Performance: Virtual Allocation vs Heap Allocation

Virtual Allocation is slower than Heap allocation because heap manager is well optimized for small memory block allocations. So, how fast is it? Here is the benchmark. The first test (List 1) is allocating 0KB to 512KB memory block 5,000,000 … Continue reading

Posted in Windows Memory Management | 2 Comments

The Windows Heap never shrinks

The Windows Heap manager is used to allocate/de-allocate relatively small size of memory blocks. It has an interesting (and sometimes annoying) characteristics – the heap never shrinks. Look at the code below. It allocates a lot of 480KB memory blocks … Continue reading

Posted in Windows Memory Management | Leave a comment

Understand process address space usage

Introduction How much memory does the process use? It’s a basic question for performance analysis, but it’s difficult to answer without understanding the Windows memory management in depth. Terminologies Process address space Each 32 bits process has 32 bits addressing … Continue reading

Posted in Windows Memory Management | Leave a comment

Monitor process memory usage status over time

Let’s assume you want to know the process address space usage overtime. Task Manager is out of question because it does not provide enough information. Even Process Explorer does not work because it does not have logging capability. One of … Continue reading

Posted in Windows Memory Management | Leave a comment