I have been attempting to find some suspected memory errors using valgrind.
Before the program being profiled even reaches the point I wish to profile, it bails as calls to mmap start failing. These calls succeed when it is not under valgrind.
Is there some kind of limit on the number of file mappings / mapped memory that is possible under valgrind ?
The size of files being mapped is large (around 600Gb total)
By default, valgrind does not support so much memory. On linux, the default (hardcoded in the sources) is 128 GB.
Note that the memory was increased from 64GB to 128 GB in commit e706fbfa9fa563e81d6dc09de2bf785b2c34e84e.
The changes in this commit will point at the needed changes to further increase the max memory supported by valgrind.
The file coregrind/m_aspacemgr/aspacemgr-linux.c contains comments explaining the strategy to manage the memory and the mappings. This indicates that possibly a fixed mapping of a size bigger that 128GB might be accepted, if you mmap it above the (current linux) 128 GB limit. (I have not tried this so this needs confirmation).
There are also other hardcoded maxima, e.g. the max nr of segments is defined (on linux) to be 30000 in aspacemgr-linux.c.