gjs_maybe_gc: mallinfo() is slow, look at /proc/self/statm instead
In commit 45b550d6, we introduced a function which attempts to force a JavaScript GC if native malloc() had allocated a lot. The major flaw with this is that on medium size processes (e.g. gnome-shell), mallinfo *is* slow. I'd only benchmarked it on smaller ones. Rather than looking at malloc, a simpler and definitely faster way to reflect on our process' memory impact is to look at RSS. Also, don't call gjs_maybe_gc() internally; leave it up to embedders to invoke manually. https://bugzilla.gnome.org/show_bug.cgi?id=643817
parent
4e7f6d8a
Please register or sign in to comment