-
-
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
Free objects with finalizer more eagerly #13995
Conversation
5d81e7b
to
558070c
Compare
Very nice! JuliaGizmos/Reactive.jl#76 (comment) suggests another source for the specific problem we were having. |
On #14127 I get: julia> gc()
julia> gc()
GC error (probable corruption) :
<?#0x7f2c6c2c4880::<?#0x7f2c6c2c4850::<?#0x7f2c6c2c4860::<?#0x7f2c6c205c10::<?#0x7f2c6c205c10::<?#0x7f2c6c205c10::<?#0x7f2c6c205c10::<?#0x7f2c6c205c10::<?#0x7f2c6c205c10::<?#0x7f2c6c205c10::<?#0x7f2c6c205c10::<?#0x7f2c6c205c10::<?#0x7f2c6c205c10::<?#0x7f2c6c205c10::<?#0x7f2c6c205c10::<?#0x7f2c6c205c10::<?#0x7f2c6c205c10::<?#0x7f2c6c205c10::<?#0x7f2c6c205c10::<?#0x7f2c6c205c10::<?#0x7f2c6c205c10::<?#0x7f2c6c205c10::<?#0x7f2c6c205c10::<?#0x7f2c6c205c10::<?#0x7f2c6c205c10::<?#0x7f2c6c205c10::•>>>>>>>>>>>>>>>>>>>>>>>>>>
signal (6): Aborted
gsignal at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x7f2e6d8fe3fa)
jl_gc_collect at /home/tim/src/julia-0.5/usr/bin/../lib/libjulia.so (unknown line)
gc at base.jl:80
jlcall_gc_22732 at (unknown line)
jl_apply_generic at /home/tim/src/julia-0.5/usr/bin/../lib/libjulia.so (unknown line)
unknown function (ip: 0x7f2e6d8cd0d3)
unknown function (ip: 0x7f2e6d8cc4c7)
unknown function (ip: 0x7f2e6d8e14d8)
jl_toplevel_eval_in_warn at /home/tim/src/julia-0.5/usr/bin/../lib/libjulia.so (unknown line)
eval at ./boot.jl:264
jl_apply_generic at /home/tim/src/julia-0.5/usr/bin/../lib/libjulia.so (unknown line)
eval_user_input at REPL.jl:3
jlcall_eval_user_input_22565 at (unknown line)
jl_apply_generic at /home/tim/src/julia-0.5/usr/bin/../lib/libjulia.so (unknown line)
anonymous at REPL.jl:92
unknown function (ip: 0x7f2e6d8d3918)
unknown function (ip: (nil))
Aborted (core dumped) |
558070c
to
f40ada0
Compare
8484cbc
to
9993f15
Compare
9993f15
to
799119d
Compare
- Checking weakref value to be null as an indicator of gc is not reliable. We probably need a finalizer for that, but all finalizers don't get called immediately at the moment (ref: JuliaLang/julia#13995). Going without that optimization for now. - fixed an issue where cache eviction was corrupting the cache
9b50a64
to
3da6fe7
Compare
3da6fe7
to
f307483
Compare
@@ -262,6 +264,12 @@ static size_t max_collect_interval = 500000000UL; | |||
|
|||
// global variables for GC stats | |||
|
|||
// Resetting the object to a young object, this is used when marking the | |||
// finalizer list to collect them the next time because the object is very | |||
// likely dead. This also won't break the GC invariance since these object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these objects
6dabec0
to
90a50d5
Compare
* Run all the finalizers at the same time in a dead reference tree * Reset objects that are only reachable from finalizer list as young and clean so that they can be collect during next quick GC without being promoted to old gen. Closes #14127
90a50d5
to
7042e36
Compare
// Reset the age and old bit for any unmarked objects referenced by the | ||
// `to_finalize` list. These objects are only reachable from this list | ||
// and should not be referenced by any old objects so this won't break | ||
// the GC invariant. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vtjnash Better?
so that they can be collect during next quick GC without being promoted to old gen.
@timholy Could you please check if this helps with the problem you have in JuliaGizmos/Reactive.jl#76 (comment) .
Closes #14127