c++ - Windows XP memory management without pagefile - what are the consequences wrt. to heap fragmentation? -


i've been looking rather elusive bug see in application on windows xp embedded system.

we've narrowed bug down pointer should pointing block of memory, instead pointing null. since memory allocated call malloc(..) going unchecked, instinct says malloc failed , returned null (though looking other possibilities right too, such race conditions may inadvertently alter pointer). native c++ application. crash little more convoluted track down cause, because had post-mortem crash dumps , failure manifested in third-party library don't have source for, on different thread. fun times :)

my questions focused on memory exhaustion possibility. of importance xp embedded system running on had its' pagefile disabled.

so, have 3 questions; it'd great if clarify these me:

  • primarily, implications of having no paging file? mean when heap grows, new memory needs found , allocated operating system, if free blocks aren't used immediately? i've seen anecdotal mentions of it, couldn't find specific effects disabling pagefile has.

  • why did microsoft decide not enable low-fragmentation heap default until windows vista? there danger enabling lfh process on windows xp?

  • what's difference in windbg between 'external fragmentation' , 'virtual address fragmentation'?

windbg reports heap statistics on affected heap follows:

heap     flags   reserv  commit  virt   free  list   ucr  virt  lock  fast                   (k)     (k)    (k)     (k) length      blocks cont. heap 04770000 00001002 1621948  94844 1608284  102    6  8068    6      2   l     virtual address fragmentation  94 % (8068 uncommited ranges) 

unlike linux, on windows allocation commitment. will able write allocated memory. performance may horrible, windows not need oom killer.

if there's no paging file, commitment must backed ram. , yet unused memory (such used during program initialization) still using ram can't paged out. there's less ram make commitment greater need.

the lfh breaks buggy programs, or better stated: buggy programs may show bugs in presence of lfh. microsoft extremely friendly towards broken programs, , making lfh opt-in xp typical example of accommodating behavior.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -