-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUGZILLA #17692] Memory leak error after calling parallel::stopCluster(< fork cluster >) #6866
Comments
Are you certain these are not red herrings? Just starting and exiting R (without doing anything with parallel) is qualitatively similar in terms of the valgrind summary: ==5050== METADATA
|
There is some memory still reachable after R shuts down, which will be freed by the operating system, so it does not cause any trouble. Looking at R -d "valgrind --leak-check=full --show-leak-kinds=all" -e "q()" so, no cluster at all, the memory is mostly fragments of the R heap (which will include heap unused by live R objects at that point), cache in serialization, the symbol table, ICU data (statically cached collator), cache of primitive methods for dispatch, connections for stdin/stdout/stderr, registered routines in DLLs and external symbols, dynamically linked objects using dlopen(), etc. Arranging for all of this memory to be explicitly freed at shutdown of R would be a lot of work and complicate the code substantially, it is not worth the effort and added cognitive complexity as the memory will be freed by the OS right away. R is not special in this, note it is common that there is "still reachable" memory at program shutdown (try basic tools from binutils,...). METADATA
|
(In reply to Benjamin Tyner from comment #1)
Yes, that is the message I obtain before even running sessionInfo(). After quitting R session I get another valgrind summary. METADATA
|
(In reply to Tomas Kalibera from comment #2)
My problem was that R CMD check was failing while running some tests in which I was making use of a FORK cluster. After switching to a PSOCK cluster it worked fine. I've been able to reproduce the error running R code other than my package, e.g.
Closing PSOCK clusters is OK (no error)
The problem comes with FORK clusters
METADATA
|
(In reply to George Vega from comment #4)
Can you provide details (including error messages) of the R CMD check which failed? METADATA
|
In general, if your package is failing its tests and valgrind reports some issues, it does not mean that those issues are causes of the failure. The reports may also be false alarms, may be benign, or may be true problems but unrelated to the failure. The same is for R, in the reports you have included, I see the benign "still reachable" memory and then the uninitialized value in do_tolower, which seems to me to be a false alarm. METADATA
|
Reproducing the error
# Session info
METADATA
The text was updated successfully, but these errors were encountered: