Comment #4 on issue 3523 by [email protected]: Deadlock after calling
IdleNotification(100) or Dispose on isolate
http://code.google.com/p/v8/issues/detail?id=3523
Ok, thanks for the correction, I know that GC doesn't "get rid of memory
leaks", it just should prevent their appearance.
I understand what are you saying with that example, however my case is a
little bit more complex. I have made available some C++ methods to
JavaScript which can return a C++ object. So when you call that method in
JavaScript, on C++ side I create a new instance which will be it's return
value. My question would be: How should I store that newly created instance
if not in a Persistent handle? I thought that it must be in a Persistent
handle because it's lifetime doesn't correspond to a C++ scope. But if I am
wrong then please explain me, how should I do that. Anyway, this is written
in the official tutorial of V8: "Use a persistent handle when you need to
keep a reference to an object for more than one function call, or when
handle lifetimes do not correspond to C++
scopes."(https://developers.google.com/v8/embed).
If I am right (it should be in a persistent handle) how I am supposed Reset
it? I think the only way is setting it to weak with a weak callback method
which will call Reset on it. In your opinion I should not use any weak
callbacks ("This is unrelated to V8"), but I am a little bit confused
(again) because in your tutorial is written the following: "A persistent
handle can be made weak, using PersistentBase::MakeWeak, to trigger a
callback from the garbage collector when the only references to an object
are from weak persistent handles."
It is true that MakeWeak doesn't exist now because it was changed to
SetWeak (it probably should be corrected).
So what should I use then if not that which is supported by your own V8 API?
My recurrent problem: It's ok that GC runs automatically, but the problem
is that I (and probably neither anyone) can't determine if it will run at
all anytime before the program stops running. I understand that if it
wasn't triggered, it means that there was allocated max. a small amount of
memory, but if I debug my program in Visual Studio it reports a lots of
memory leaks (still reachable in valgrind) and this makes it very hard to
find out which on of these are REAL memory leaks (not related to V8). I
hope you understand my concerns.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.