|
From: Nicholas N. <nj...@cs...> - 2007-05-24 22:25:00
|
On Thu, 24 May 2007, Julian Seward wrote: >> 1) Why 0x38000000? It just seems such a weird number to me. > > It seems arbitrary but in fact it is a good compromise given the > constraints. In most cases Linux allows processes to access the > lowest 3GB of memory, but sometimes this is limited to 2 or even > 1 GB. So 0x38000000 is (7/8) * 1 GB, so V will work even on a > system with only 1GB for user space. However, 0x38000000 is > almost always far away from the default load address of executables > (which is usually much lower) and so it pretty much guarantees that > V will not conflict with the client executable's load address. If you run "cat /proc/self/maps" you'll see how the address space normally is laid out, and "valgrind cat /proc/self/maps" how Valgrind changes this. Only the tool+core binary gets loaded at 0x38000000, and it's something like 2.5MB, ie. small. All the other memory dynamically allocated by the tool and core can go anywhere. Nick |