-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory management guidelines / use of unref() #282
Comments
Hey, thanks for the report. Node-Gtk does use V8 weak references/finalizer callbacks to call either
Could you try running your application with |
Oh, I had run it with expose-gc and called gc at every callback, this did not change anything. I think the problem lies more on the gobject/gtk side. Note that the thing that prompted me to use I suppose it protects the reference in its JavascriptCore running context, not in gtk/gobject, but still. Maybe there are some non-obvious things going on related to memory in this case ? |
Normally the V8 value is GC'ed and when it is, node-gtk will call The docs for getJsValue says that the value has You can inspect the refcount of the object with |
Hello,
I have come across something curious.
I'm using a webkit web view and have some javascript send stuff to my node code through script-message-received
In the callback I do something akin to :
If I don't call
.unref()
on the JscValue, it's -- I think -- not collected if I were to believe the increased memory usage of my application. With.unref()
, it stays more or less at the same memory size.Which leads me to the question ; is the whole gobject ref counting to be done by hand or does node-gtk has stuff in place using V8's finalizers in some way ?
Are there any "official" guidelines around this ?
Should there be something about memory management in the doc ?
Or rather more simply put ; is my
.unref()
call expected or is this some oversight from node-gtk ?Great lib either way.
The text was updated successfully, but these errors were encountered: