Hi Oliver, thanks for the response.
Part of the comments for IdleNotification are:
- Optional notification that the embedder is idle.
- V8 uses the notification to reduce memory footprint.
- This call can be used repeatedly if the embedder remains idle.
- Returns true if the embedder should stop calling IdleNotification
- until real work has been done. This indicates that V8 has done
- as much cleanup as it will be able to do.
So the Collect method is calling IdleNotification until V8 says there is no more cleanup that it can do.
That seems like a reasonable guarantee that V8 has cleaned up all the objects it can.
I assume that is as good as a strong reference in C#.
Also the following url indicates that we should be maintaining V8 weak handles that provide us with callbacks to know when it cleans up an object so we can properly dispose of the underlying External object:
There are no places in the noesis source code where MakeWeak() is called which makes me really think this could be the missing piece.
What is your relation to the project if you don't mind me asking?
I'm going to see if I can implement the V8 weak references stuff, but neither C++ CLI or native C++ are my strong points.
If there's an active maintainer I'd love to work with them to solve the problem.
Thanks for your help.