
I've just added another debugging category to the debug logging code, so now object finalization is reported in the log.
Finalization is a special step taken before freeing those objects which the collector cannot automatically clean up (e.g. because they need to release non-collector-managed resources).
Classes with finalizers include SPDocument and SPDesktop.
Try it out with latest SVN:
INKSCAPE_DEBUG_LOG=debug.xml INKSCAPE_DEBUG_FILTER=REFCOUNT,FINALIZERS src/inkscape
Open some documents, close them, and before closing the last one, go to the "About Memory" dialog and click "recalculate" a few times to make sure that a garbage collection pass gets run.
Then look at debug.xml. You can see not only when the finalization of an object happened, but also what debugging events (in this case refs/unrefs) happened during its finalizer.
-mental

You wrote
I've just added another debugging category to the debug logging code, so now object finalization is reported in the log. ... Open some documents, close them, and before closing the last one, go to the "About Memory" dialog and click "recalculate" a few times to make sure that a garbage collection pass gets run.
Then look at debug.xml. You can see not only when the finalization of an object happened, but also what debugging events (in this case refs/unrefs) happened during its finalizer.
This begs the question if it's possible to turn on logging before startup. If possible one could then find leaks by ref/unref comparison using a script on the xml.
ralf

On Sun, 2006-04-30 at 19:39 +0200, Ralf Stephan wrote:
This begs the question if it's possible to turn on logging before startup. If possible one could then find leaks by ref/unref comparison using a script on the xml.
I'm not sure I understand -- logging always begins before Inkscape startup. It's enabled by setting an environment variable.
Unfortunately, you won't be able to _automatically_ find leaks this way, because not everything is unreffed before shutdown (when it gets freed anyway).
-mental
participants (2)
-
MenTaLguY
-
Ralf Stephan