O'Reilly logo

Memory Dump Analysis Anthology, Volume 8a by Dmitry Vostokov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Memory Leak (Regions)

The set of memory dumps that prompted to introduce Insufficient Memory pattern for stack trace database (page 57) also prompted to include a variant of Memory Leak pattern related to regions of virtual memory address space. We created this simple modeling application:

 int _tmain(int argc, _TCHAR* argv[])                                          
 {                                                                             
         int i,j;                                                              
         for (i = 1; i < 1000; ++i)                                            
         {                                                                     
                 for (j = 1; j < 1000; ++j)                                    
                 {                                                             
                        VirtualAlloc(NULL, 0x10000, MEM_RESERVE,               
                                      PAGE_EXECUTE_READWRITE);                 
                 }                                                             
                 getc(stdin);                                                  
         }                                                                     
         return 0;                                                             
 }                                                                             

We allocated only reserved memory regions. Committing them would probably at some stage manifest Insufficient Memory patterns for committed memory (Volume 1, page 302) and physical memory (Volume 3, page 104). So we took a few consecutive memory dumps and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required