At Thu, 07 Nov 2019 20:16:29 +0000, Sage Gerard wrote:
> To add: Is it wise to put (begin (sync (system-idle-evt)) (collect-garbage))
> in a flush callback on the exit handler's plumber?
I should have clarified that if you need a finalizer to run when Racket
shuts down, then finalization alone is not a good choice. Instead,
`register-finalizer-and-custodian-shutdown` may be the way to go.
A `(begin (sync (system-idle-evt)) (collect-garbage))` is useful when
exploring a potential leak, but it's not reliable for making sure that
everything that could possibly be finalized is finalized. There's just
not a good way to do that with finalizers. But custodians provide
predictable shutdown behavior.
So, adding `(begin (sync (system-idle-evt)) (collect-garbage))` to a
plumber does not seem useful, because the effect is not predictable
enough to rely on.