|
From: Nicholas N. <nj...@ca...> - 2004-06-22 16:36:36
|
On Tue, 22 Jun 2004, Nicholas Nethercote wrote: > * On my machine, normally, the heap is roughly 800MB, and the space for > mmap segments is 2GB. (I compute this from the usual heap start being > slightly bigger than 0x8048000, and mmap segments usually starting at > 0x40000000, and the kernel starting at 0xc0000000). So the heap is about > 2--2.5x smaller than the mmap segment area. But under Valgrind, the > "heap" (client_base..client_mapbase distance) is set to be 3x the mmap > segment area (client_mapbase..client_end). Surely the ratios should be > similar to normal execution? If I change the ratio from 3x to 0.5x, I get > a heap size of 441MB and mmap-segment size of 882MB, and can mmap 640MB > segments in Memcheck (up from 235MB). [Actually, it's complicated by > Memcheck's replacement malloc() not using brk() but rather mmap(). Hmm.] Actually, I think this is even better than I first thought. For those tools that don't replace malloc(), AFAICT the standard malloc() falls back on mmap() (instead of brk()) for any allocations larger than about 100KB, or if the brk() fails. So reducing the heap size doesn't matter at all. And for tools that do replace malloc(), I think V's malloc doesn't do any malloc mmapping below client_mapbase anyway -- in which case the client "heap" (client_baase..client_mapbase) is barely being used? N |