It would be nice to measure the memory leak with a tool like valgrind+massif, but I failed to achieve that (https://code.wildfiregames.com/rP5154#inline-2592).
Even with memory allocation measuring (using `ps`) I could not notice an increase in allocated pages at all, with millions of registered objects.
Read the spidermonkey documentation.