[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gtk-devel
Subject:    Re: Memory tracking in GJS
From:       Giovanni Campagna <scampa.giovanni () gmail ! com>
Date:       2014-02-20 12:53:09
Message-ID: CABkLShHhLeOKmQ8fROM64up2PcB-ofb0XphZ6kuUujmsmtNU5A () mail ! gmail ! com
[Download RAW message or body]

2014-02-20 2:50 GMT+01:00 Cosimo Cecchi <cosimoc@gnome.org>:
> Hi all,
>
> The state of garbage collection for typical GTK/JS applications is pretty
> sad these days. mozjs will execute a garbage collection run when it thinks
> around 30MB of allocations have been done.

It's worth pointing out that mozjs will *force* a garbage collect if
you go over the malloc limit (a dynamic value between 30 and 90 MB),
but will garbage collect a lot more often if you call MaybeGC. Firefox
does that at the end of the every user script (with a comment saying
it's for sunspider), maybe we can do the same in gjs?
Additionally, gjs does not support the more advanced forms of GC, so
they trigger less often and block longer. See #724797 for incremental
GC for example.

> Any other ideas? I feel this is a fundamental enough issue that there must
> be a good way to design a generic solution.

We can probably look into mallinfo() as well, it offers a reasonable
estimate of the memory usage for a single threaded application
(because most allocations happen from the main arena).

Giovanni
_______________________________________________
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic