-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Garbage collection is not working in this case on linux #25884
Comments
Try running |
@ararslan I tried. It didn't work. |
What's the values you see and what value did you read (edit: from |
Confirmed again on |
Confirmed again on
|
FWIW, in my experience the same kind of thing happens with R, which releases memory much better on Windows than on Linux. See https://bugs.r-project.org/bugzilla/show_bug.cgi?id=14611 for a more detailed explanation by R developers. |
@ararslan I understand your claim. However, it would still be too miraculous since uncommenting the line |
As an extra data point, on Windows 7 and julia 1.01, the memory does get released after a single |
As an extra datapoint, I cannot reproduce on linux either, i.e. the memory gets released after a single
@Mistguy Did you use a source build or a binary distribution? |
I see it here on Fedora 28 (kernel 4.18.7, glibc 2.27) both with a recent git master and 1.0.1 (official binaries). Memory usage goes down from 1.9GB to 1.7GB after calling What's your Linux kernel and glibc version? Julia Version 1.0.1
Commit 0d713926f8 (2018-09-29 19:05 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.0 (ORCJIT, skylake) |
@chethega I am using the official binary, on linux kernel 4.4.155. |
@chethega Since you say you cannot reproduce the problem, can you give more details on your system? Could other people try on Linux too? BTW, there are news on the R bug I had mentioned (see also linked thread). Apparently glibc's |
I tried again. Procedure: copy-paste your setup code into the REPL. Run Results: Memory return to the kernel is unreliable. Sometimes julia returns the memory to the kernel, but sometimes it gets stuck and keeps the memory. The memory is used for subsequent allocations (also allocs that are not by I noticed that subsequent larger allocations (e.g. a single 2g buffer) don't reuse the memory. If we keep the page mappings then this is unavoidable (because the new buffer must be contiguous), but we could remap the old pages. I think that is the job of the libc, though? System: Archlinux with
|
On Arch ( |
Interesting! Has anything changed since 0.6 that could explain the difference? Have you tried with official binaries, custom builds, or Arch packages? I wonder whether the Julia GC call |
These are both source builds. I built Julia-0.6 on 19 Feb (so after the last system-update) and Julia 1.1 on 22 Jan (so before the last system-update). |
Related issue in Ruby: https://www.joyfulbikeshedding.com/blog/2019-03-14-what-causes-ruby-memory-bloat.html Seems probable that we should be calling |
Closing as dup of #30653 |
This issue is also posted on https://discourse.julialang.org/t/garbage-collection-is-not-working-in-this-case-on-linux/8798 but is not getting any attention. Since this is possibly a bug, I am reposting it here:
I have a minimal working example here:
Then in REPL, I type
However, the memory usage of
NoTBModel
created increatemodel
function is not released. Strangely, changing only one line of the code (see the comment in the code) solves the problem. I tracked the usage of memory throughtop
in linux. This issue does NOT happen in Windows.Tested on
and
The text was updated successfully, but these errors were encountered: