Skip to content
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

fix #30653, call malloc_trim sometimes #32428

Merged
merged 1 commit into from
Jun 27, 2019
Merged

fix #30653, call malloc_trim sometimes #32428

merged 1 commit into from
Jun 27, 2019

Conversation

JeffBezanson
Copy link
Sponsor Member

@JeffBezanson JeffBezanson commented Jun 26, 2019

This works around what seems to be a glibc bug. Fixes #30653

@cstjean See if this fixes your original case.

this works around what seems to be a glibc bug
@JeffBezanson JeffBezanson added performance Must go faster GC Garbage collector backport 1.2 labels Jun 26, 2019
@JeffBezanson
Copy link
Sponsor Member Author

@nanosoldier runbenchmarks(ALL, vs=":master")

@nanosoldier
Copy link
Collaborator

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan

@ViralBShah
Copy link
Member

If this is an issue on only certain versions of glibc, is it worthwhile to apply this fix only if the user is using a glibc version that's bad?

@JeffBezanson
Copy link
Sponsor Member Author

I don't think so; with this change we'll only call malloc_trim if there's significant heap growth so it shouldn't take much time. And I don't want to bother tracking down which versions are affected.

@JeffBezanson JeffBezanson merged commit f77743c into master Jun 27, 2019
@JeffBezanson JeffBezanson deleted the jb/fix30653 branch June 27, 2019 18:29
JeffBezanson added a commit that referenced this pull request Jun 27, 2019
this works around what seems to be a glibc bug
(cherry picked from commit f77743c)
@KristofferC KristofferC mentioned this pull request Jul 1, 2019
32 tasks
@cstjean
Copy link
Contributor

cstjean commented Oct 25, 2019

I'm seeing some fairly large trim difference for my code. I create temporaries which grow usage to 11GB. Then GC brings me down to ~4GB. Then explicitly calling malloc_trim gets me another 2GB.

julia> memory_usage() / 1.e9
4.618551296

julia> GC.gc()

julia> memory_usage() / 1.e9
4.61774848

julia> malloc_trim()  # the ccall
1

julia> memory_usage() / 1.e9
2.462871552

I guess that's to be expected given this PR? It's not a problem for us at the moment. I assume that it will be trimmed automatically eventually...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GC Garbage collector performance Must go faster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Memory leak with function redefinition
5 participants