Open oj-lappi opened 10 months ago
Thanks for filing this. I dug into it a bit this weekend, and correlated some minor memory leaks back to our main
development branch. I ran out of time before finishing my investigation back into the v4.1.x branch; it'll take me a little more time to dig into this properly.
Background information
What version of Open MPI are you using? (e.g., v3.0.5, v4.0.2, git branch name and hash, etc.)
4.1.6 (also verified on 4.0.3)
Describe how Open MPI was installed (e.g., from a source/distribution tarball, from a git clone, from an operating system distribution package, etc.)
Debians libopenmpi-dev package (also verified on Ubuntu)
If you are building/installing from a git clone, please copy-n-paste the output from
git submodule status
.Please describe the system on which you are running
Details of the problem
MPI_Intercomm_create seems to leak memory, calling MPI_Comm_free on an intercomm does not free all memory allocated for the intercomm.
Here is a minimal example which you can build to see the issue:
If you just watch the resident set size of two processes executing this, you will see them increasing linearly in time, with one process allocating roughly double what the other one does.
Compiling this with clang++-16 and -fsanitize=address, and running
mpirun -n 2 a.out
gives (among other minor memory leak output), the following output for iterations=100000:I find the inclusion of vasprintf most surprising in the stack traces.