|
From: Nicholas N. <nj...@cs...> - 2006-09-13 16:09:08
|
On Tue, 12 Sep 2006, Mohit Tiwari wrote: > I have just begun to use Valgrind, and am building a simple tool to quantify > the performance hit on the target application on the increasing the amount > of instrumentation. I read that Valgrind allocates 256MB in the higher part > of the virtual address space for itself and its tools. I was wondering if > the memory once allocated remains fixed? Or can Valgrind also move the > memory allocated to a tool to a different virtual address, in some > circumstance? Thanks a lot, What you read is probably out of date. The memory layout has changed various times over the years. If you run with the -d option, you'll get a message like the one below at startup which tells you the initial memory layout. The segments marked with "(0)" are those for Memcheck's initial memory usage, it only takes up 1.25MB (it allocates more later on, of course). This memory is not movable once Memcheck is loaded. You can change the load address by changing "valt_load_address_normal" in configure.in and then reconfiguring and rebuilding. Nick --22722:1:aspacem <<< SHOW_SEGMENTS: Memory layout at client startup (26 segmen ts, 3 segnames) --22722:1:aspacem ( 0) /home/njn/grind/trunk1/memcheck/memcheck-x86-linux --22722:1:aspacem ( 1) /bin/date --22722:1:aspacem ( 2) /lib/ld-2.3.5.so --22722:1:aspacem 0: RSVN 0000000000-000023BFFF 2342912 ----- SmFixed --22722:1:aspacem 1: file 000023C000-0000255FFF 106496 r-x-- d=0xFD00 i=1962 26 o=0 (2) --22722:1:aspacem 2: file 0000256000-0000257FFF 8192 rw--- d=0xFD00 i=1962 26 o=102400 (2) --22722:1:aspacem 3: RSVN 0000258000-00007DBFFF 5783552 ----- SmFixed --22722:1:aspacem 4: ANON 00007DC000-00007DCFFF 4096 r-x-- --22722:1:aspacem 5: RSVN 00007DD000-0003FFFFFF 56m ----- SmFixed --22722:1:aspacem 6: 0004000000-0008047FFF 64m --22722:1:aspacem 7: file 0008048000-0008051FFF 40960 r-x-- d=0xFD00 i=8241 474 o=0 (1) --22722:1:aspacem 8: file 0008052000-0008052FFF 4096 rw--- d=0xFD00 i=8241 474 o=40960 (1) --22722:1:aspacem 9: anon 0008053000-0008053FFF 4096 rwx-- --22722:1:aspacem 10: RSVN 0008054000-0008852FFF 8384512 ----- SmLower --22722:1:aspacem 11: 0008853000-0037FFFFFF 759m --22722:1:aspacem 12: FILE 0038000000-0038020FFF 135168 r-x-- d=0xFD00 i=7230 305 o=0 (0) --22722:1:aspacem 13: file 0038021000-0038021FFF 4096 r-x-- d=0xFD00 i=7230 305 o=135168 (0) --22722:1:aspacem 14: FILE 0038022000-0038130FFF 1110016 r-x-- d=0xFD00 i=7230 305 o=139264 (0) --22722:1:aspacem 15: FILE 0038131000-0038131FFF 4096 rw--- d=0xFD00 i=7230 305 o=1245184 (0) --22722:1:aspacem 16: ANON 0038132000-0038843FFF 7413760 rw--- --22722:1:aspacem 17: 0038844000-0061E2BFFF 661m --22722:1:aspacem 18: RSVN 0061E2C000-0061E2CFFF 4096 ----- SmFixed --22722:1:aspacem 19: ANON 0061E2D000-00623BFFFF 5844992 rwx-- --22722:1:aspacem 20: 00623C0000-00BE257FFF 1470m --22722:1:aspacem 21: RSVN 00BE258000-00BEC56FFF 9m ----- SmUpper --22722:1:aspacem 22: anon 00BEC57000-00BEC57FFF 4096 rwx-- --22722:1:aspacem 23: 00BEC58000-00BFC42FFF 15m --22722:1:aspacem 24: ANON 00BFC43000-00BFC58FFF 90112 rw--- --22722:1:aspacem 25: RSVN 00BFC59000-00FFFFFFFF 1027m ----- SmFixed --22722:1:aspacem >>> |