I'm now running this on a machine with 2GB memory. I turn off all the options that lead to large memory use in my program. This is without -race:
29459 root 20 0 203876 10296 4288 S 27.8 0.5 0:07.81
29459 root 20 0 203876 10296 4288 R 25.9 0.5 0:08.07
29459 root 20 0 203876 10532 4288 S 25.8 0.5 0:08.33
29459 root 20 0 203876 10784 4472 R 25.8 0.5 0:08.59
29459 root 20 0 204964 10784 4472 S 23.8 0.5 0:08.83
29459 root 20 0 204964 11016 4476 S 22.9 0.5 0:09.06
29459 root 20 0 204964 11016 4476 S 24.9 0.5 0:09.31
29459 root 20 0 204964 11016 4476 S 26.8 0.5 0:09.58
29459 root 20 0 204964 11512 4476 R 29.8 0.6 0:09.88
29459 root 20 0 204964 11512 4476 S 26.8 0.6 0:10.15
And this is with -race (crash after last line):
29459 root 20 0 204964 11512 4476 S 25.5 0.6 0:12.62
29459 root 20 0 204964 11512 4476 S 26.8 0.6 0:12.89
29459 root 20 0 204964 11512 4476 S 27.8 0.6 0:13.17
29459 root 20 0 204964 11768 4488 S 25.8 0.6 0:13.43
29459 root 20 0 204964 11768 4488 S 26.8 0.6 0:13.70
29459 root 20 0 206052 12012 4488 S 31.8 0.6 0:14.02
29459 root 20 0 206052 12012 4488 S 25.8 0.6 0:14.28
29459 root 20 0 206052 12264 4488 S 25.9 0.6 0:14.54
29459 root 20 0 206052 12524 4488 S 32.8 0.6 0:14.87
29488 root 20 0 2679060 34504 4700 S 17.9 1.7 0:00.30
29488 root 20 0 23.922g 161924 4788 R 151.0 7.9 0:01.82
29488 root 20 0 42.486g 258900 4788 S 157.1 12.6 0:03.41
29488 root 20 0 56.890g 348908 4788 R 158.9 17.0 0:05.01
29488 root 20 0 62.764g 415764 4796 R 161.9 20.3 0:06.64
29488 root 20 0 72.008g 469596 4804 R 165.8 22.9 0:08.31
29488 root 20 0 81.625g 542292 4804 R 168.8 26.5 0:10.01
29488 root 20 0 89.334g 606220 4804 S 169.8 29.6 0:11.72
29488 root 20 0 93.250g 664324 4804 S 171.9 32.4 0:13.45
29488 root 20 0 98.775g 719612 4808 S 175.7 35.1 0:15.22
29488 root 20 0 0.105t 793280 4808 S 174.5 38.7 0:16.98
29488 root 20 0 0.109t 854148 4808 S 173.8 41.7 0:18.73
29488 root 20 0 0.115t 914416 4808 S 170.8 44.6 0:20.45
29488 root 20 0 0.120t 966244 4808 S 175.7 47.1 0:22.22
29488 root 20 0 0.125t 0.977g 4808 S 180.8 50.0 0:24.04
29488 root 20 0 0.130t 1.042g 4808 S 179.7 53.3 0:25.85
29488 root 20 0 0.137t 1.098g 4808 S 179.1 56.2 0:27.66
29488 root 20 0 0.143t 1.159g 4808 S 180.8 59.3 0:29.48
29488 root 20 0 0.148t 1.217g 4808 S 178.2 62.2 0:31.28
29488 root 20 0 0.152t 1.276g 4808 S 181.7 65.3 0:33.11
29488 root 20 0 0.158t 1.335g 4808 S 178.8 68.3 0:34.91
29488 root 20 0 0.163t 1.400g 4808 S 177.8 71.6 0:36.70
29488 root 20 0 0.170t 1.462g 4808 S 179.6 74.8 0:38.51
You can see the non-race is using barely 12MB. The race version fills the available memory.