Status: New
Owner: ----

New issue 3523 by [email protected]: Deadlock after calling IdleNotification(100) or Dispose on isolate
http://code.google.com/p/v8/issues/detail?id=3523

Hi all,
Except the problem, mentioned in the title of this issue I have also more questions according to the functionality of V8. Besides that that I could not find any relevant documentation about the V8's usability, there are lots of those methods, mainly regarding the work with the V8's garbage collector, which I don't really understand how and when could be used.

1. Problem: Memory deallocation
I know that about this problem exist several other issues, but I still don't know the answer for the primal question: Is there any way to run the GC and get rid of all the memory leaks 100%-ly or using methods like IdleNotification, AdjustAmountOfExternalAllocatedMemory, LowMemoryNotification, etc. deallocates only MAYBE the used memory of the program. I would be really greatful if someone could answer me for this question. Of course if the answer is YES I would be very thankful if someone could describe me how to do it. Thanks in advance.

2. Problem: Use of the method IdleNotification
I had a few problems when I called this method at the end of my program in order to get rid of my memory leaks (force GC to do it). I have realized that if I call it with a greater argument than 99 (100-1000) then sometimes (in 50% of the cases) the program get into a deadlock and it never stops. Is this an expected behavior or just a bug? Here is my call-stack pointing to the semaphore which waits till the infinity.
xxx.exe!v8::base::Semaphore::Wait()  Line 159   C++
xxx.exe!v8::internal::SweeperThread::WaitForSweeperThread()  Line 66 C++
xxx.exe!v8::internal::MarkCompactCollector::EnsureSweepingCompleted() Line 597 C++
xxx.exe!v8::internal::Heap::IdleNotification(int hint)  Line 4343       C++
xxx.exe!v8::Isolate::IdleNotification(int idle_time_in_ms)  Line 6725   C++

If I run IdleNotification with 99 the deadlock never appeares. The problem is in the next call (next problem).

3. Problem: Deadlock after calling isolate->Dispose()

So here is the code which I have at the end of my main function:
isolate->IdleNotification(99);
isolate->Dispose();
v8::V8::Dispose();

If I would not call one of these methods, the program would end with memory leaks which I can't let happen. After calling IdleNotification(99) without any deadlocks the next deadlock appears after calling isolate->Dispose(). This deadlock's appearence is similar to the previously noticed one, only in 50% of the cases.
Here you can see the call-stack pointing to the Wait call:
xxx.exe!v8::base::Semaphore::Wait()  Line 159   C++
xxx.exe!v8::internal::SweeperThread::Stop()  Line 55    C++
xxx.exe!v8::internal::Isolate::Deinit()  Line 1566      C++
xxx.exe!v8::internal::Isolate::TearDown()  Line 1531    C++
xxx.exe!v8::Isolate::Dispose()  Line 6548       C++

Operation system informations:
The described problems are appearing only on Windows. I have tried my program on Windows 7, 32bit, V8 sources builded into static libraries. I have also tried it on Linux, Ubuntu 14.04, 64bit and there everything works. No memory leaks and no deadlocks.

So, these are my problems. If anyone could help me to solve them (or at least one of them) I would really appreciate it.

Thanks for your help in advance.

--
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.

Reply via email to