I have a function that takes a set of parameters, runs a simulation, and returns 5 values in a named tuple. It does no IO and only calls rand() with a seeded RNG that is explicitly passed to hopefully avoid any unsafe threading.
If I run Julia (nightly on linux skylake Xeon) with 4 threads, it will work well for a small number of iterations, but then the memory usage will gradually creep up. Each iteration takes 1-2 seconds, so with the normal GC noise, I expect the memory usage to go up and down by 200MB every few seconds.
For example, in the first few minutes, Julia will use 400-600MB, but by 10 minutes, it’s over 1GB, and by an hour, it’s at 30GB (but still with the 200MB variations).
When I run the same code with pmap and 4 workers, each worker stays between 250-310MB with no leakage even after hours.