I have a separate disk where I store all git and bzr trees: /media/DATA/maria-bzr/.
There is a convenience symlink from home directory:
Now I clone a tree:
And compile an out-of-source build:
Now I run a test:
It ignores the --mem option and creates a real var subdirectory under the current directory, instead of symlinking it to a random sub directory at /dev/shm/.
As a result, the entire ./mtr runs about 4 hours instead of 20 minutes.
Note, it works as expected when I use a in-source tree: