node-gtk icon indicating copy to clipboard operation
node-gtk copied to clipboard

Memory leak: events (GC is not running)

Open romgrk opened this issue 5 years ago • 1 comments

Source: https://github.com/romgrk/node-gtk/issues/177#issuecomment-700976292

hi, i further examined some problems with my node-gtk app and extended the drawing area example with moving the circle arround with the mouse where i detected increasing memory and checked with valgrind - here is the result when moving the circle arround for some seconds (it seems there is also a leak by only moving the mouse) - i hope this helps:

Example: https://gist.github.com/romgrk/97733a62b8152e853dddb6c524af1bdc

romgrk avatar Oct 17 '20 02:10 romgrk

After inspection, it appears that EventMotion objects are cleared properly, but only when V8's GC runs. Weirdly enough, I have done a lot of mouse wiggling and couldn't see the GC running :/

The gist above is however able to confirm that the memory is cleared correctly by manually invoking the GC by clocking on the button. (must be run with node --expose-gc event-memory-leak.js so JS can call the GC)

Not sure why the GC isn't running but this is not ideal. I'll try to find out more.

ping @docb in case you're interested

romgrk avatar Oct 17 '20 03:10 romgrk