Comment #6 on issue 3523 by [email protected]: Deadlock after calling
IdleNotification(100) or Dispose on isolate
https://code.google.com/p/v8/issues/detail?id=3523
Ok, I completely understand those 3 statements of yours. But what is
written in the third one is the whole point in my case. I don't want to
wait with the deallocation of my C++ instances, instanced during JavaScript
runtime, because I don't need them till the end of my whole program. That
is why I wanted to use weak callbacks.
I also understand that in V8 nothing is guaranteed which is somehow related
to the garbage collecting and that is true also for weak callbacks because
they are triggered from the garbage collector when the only reference(s) to
the given object is/are from weak persistent handle(s). That is why I can't
use weak callbacks - I cannot be sure if they ever will be triggered, so I
cannot destroy anything important inside their body. Under "important" I
mean such objects that must be destroyed or otherwise it would cause a
memory leak.
So, to summarize the current situation:
- I cannot be sure if the GC will ever be called if I run my program.
- I cannot be sure if the GC will ever trigger my weak callbacks.
- I cannot use any finalization methods because they are unpredictable
(because of the deadlocks which I have reported) and their use is a "bad
idea" anyway (I don't really understand when would be a "definitely good
idea" to use them OR if there aren't such cases why are these methods in
the V8 API).
- It seems that there is only one thing I can do: Remove all the weak
callbacks and hope that when it would be necessary V8 would call the
garbage collector and until then just ignore the "definitely
lost", "possibly lost" and "still reachable" valgrind leak reports. And
yeah these are definitely because of that the GC wasn't called. Just to see
the difference (on Linux are working also your "funny notifications", on
Windows the same code causes a deadlock - already reported in my first
post):
1. Without isolate disposal and without calling IdleNotification:
==3935== HEAP SUMMARY:
==3935== in use at exit: 343,697 bytes in 182 blocks
==3935== total heap usage: 48,484,112 allocs, 48,483,930 frees,
13,720,585,523 bytes allocated
==3935== LEAK SUMMARY:
==3935== definitely lost: 48 bytes in 1 blocks
==3935== indirectly lost: 0 bytes in 0 blocks
==3935== possibly lost: 7,305 bytes in 45 blocks
==3935== still reachable: 336,344 bytes in 136 blocks
==3935== suppressed: 0 bytes in 0 blocks
2. With IdleNotification(99); and isolate->Dispose():
==3968== HEAP SUMMARY:
==3968== in use at exit: 0 bytes in 0 blocks
==3968== total heap usage: 48,484,344 allocs, 48,484,344 frees,
13,721,019,547 bytes allocated
==3968==
==3968== All heap blocks were freed -- no leaks are possible
--
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.