Re: Memory tracking in GJS

2014-03-03 Thread Andy Wingo
On Sun 02 Mar 2014 22:39, Colin Walters walt...@verbum.org writes: On Sun, Mar 2, 2014 at 3:37 PM, Andy Wingo wi...@pobox.com wrote: Ideally GLib could define an interface void g_register_allocation (size_t bytes, char *for_whom); What about GLib libraries which wrap non-GLib

Re: Memory tracking in GJS

2014-03-02 Thread Andy Wingo
Hi, A little late here. SM's GC needs to know about all allocations that it might collect, both those that it can trace and those that it can't. Ideally GLib could define an interface void g_register_allocation (size_t bytes, char *for_whom); and GJS should register some listener on that

Re: Memory tracking in GJS

2014-03-02 Thread Colin Walters
On Sun, Mar 2, 2014 at 3:37 PM, Andy Wingo wi...@pobox.com wrote: Ideally GLib could define an interface void g_register_allocation (size_t bytes, char *for_whom); What about GLib libraries which wrap non-GLib libraries that do the heavy lifting? For example, the gjs wrappers for cairo.

Re: Memory tracking in GJS

2014-02-25 Thread Cosimo Cecchi
On Tue, Feb 25, 2014 at 11:08 AM, Bastien Nocera had...@hadess.net wrote: On Mon, 2014-02-24 at 13:56 -0800, Cosimo Cecchi wrote: Thanks all for your inputs; I now posted a first iteration of a patch that implements the suggestions of this thread here

Re: Memory tracking in GJS

2014-02-24 Thread Cosimo Cecchi
Thanks all for your inputs; I now posted a first iteration of a patch that implements the suggestions of this thread here https://bugzilla.gnome.org/show_bug.cgi?id=725099 Cheers, Cosimo On Thu, Feb 20, 2014 at 6:09 AM, Colin Walters walt...@verbum.org wrote: On Wed, Feb 19, 2014 at 8:50 PM,

Re: Memory tracking in GJS

2014-02-20 Thread Giovanni Campagna
2014-02-20 2:50 GMT+01:00 Cosimo Cecchi cosi...@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

Re: Memory tracking in GJS

2014-02-20 Thread Ryan Lortie
hi, On Thu, Feb 20, 2014, at 7:53, Giovanni Campagna wrote: 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. My preferred solution to the

Re: Memory tracking in GJS

2014-02-20 Thread Colin Walters
On Wed, Feb 19, 2014 at 8:50 PM, Cosimo Cecchi cosi...@gnome.org wrote: Hi all, The state of garbage collection for typical GTK/JS applications is pretty sad these days. It's worth a comparison with (C)Python. In some ways, Python's hybrid refcount + GC is the worst of both worlds - you

Memory tracking in GJS

2014-02-19 Thread Cosimo Cecchi
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. The problem is that for a native GObject wrapped into a JSObject there are effectively two sets

Re: Memory tracking in GJS

2014-02-19 Thread Sam Spilsbury
Hi, On Thu, Feb 20, 2014 at 9:50 AM, Cosimo Cecchi cosi...@gnome.org wrote: Any other ideas? I feel this is a fundamental enough issue that there must be a good way to design a generic solution. Something else that's quite controversial would be to add a new, optional virtual function to