Skip to content
Commit 7aae32d1 authored by Colin Walters's avatar Colin Walters
Browse files

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
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment