This came up when looking at diagnostics for Node. When we run out of 
memory in the v8 heap the failure is usually raised here:

 0: [pc=0x951ea5] v8::Utils::ReportApiFailure(char const*, char const*) 
[node]
 1: [pc=0x9520a2] v8::internal::V8::FatalProcessOutOfMemory(char const*, 
bool) [node]
 2: [pc=0xc19e88] v8::internal::Factory::NewUninitializedFixedArray(int) 
[node]

and we can get the JavaScript stack OK. However, quite often it raises the 
failure here:

 0: [pc=0x951ea5] v8::Utils::ReportApiFailure(char const*, char const*) 
[node]
 1: [pc=0x9520a2] v8::internal::V8::FatalProcessOutOfMemory(char const*, 
bool) [node]
 2: [pc=0xc75a0d] 
v8::internal::MarkCompactCollector::EvacuateNewSpaceVisitor::Visit(v8::internal::HeapObject*)
 
[node]
 3: [pc=0xc7d24d] 
v8::internal::MarkCompactCollector::VisitLiveObjects(v8::internal::MemoryChunk*,
 
v8::internal::MarkCompactCollector::HeapObjectVisitor*, 
v8::internal::MarkCompactCollector::IterationMode) [node]
 4: [pc=0xc7d9d8] 
v8::internal::MarkCompactCollector::StartParallelCompaction(v8::internal::MarkCompactCollector::Evacuator**,
 
int) [node]
 5: [pc=0xc7dec7] 
v8::internal::MarkCompactCollector::EvacuatePagesInParallel() [node]
 6: [pc=0xc801d7] 
v8::internal::MarkCompactCollector::EvacuateNewSpaceAndCandidates() [node]
 7: [pc=0xc81619] v8::internal::MarkCompactCollector::CollectGarbage() 
[node]
 8: [pc=0xc5fa5d] v8::internal::Heap::MarkCompact() [node]
 9: [pc=0xc600b0] 
v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, 
v8::GCCallbackFlags) [node]
10: [pc=0xc603a2] 
v8::internal::Heap::CollectGarbage(v8::internal::GarbageCollector, char 
const*, char const*, v8::GCCallbackFlags) [node]
11: [pc=0xc60778] v8::internal::Heap::CollectAllAvailableGarbage(char 
const*) [node]
12: [pc=0xc19700] v8::internal::Factory::NewFillerObject(int, bool, 
v8::internal::AllocationSpace) [node]
13: [pc=0xe32371] v8::internal::Runtime_AllocateInTargetSpace(int, 
v8::internal::Object**, v8::internal::Isolate*) [node]

and if I try to get the JavaScript stack, the call to 
Message::PrintCurrentStackTrace() hangs. There is a fairly recent v8 code 
change here which looks like it anticipated or allowed for this:

heap.cc line 5052
    if (gc_state() == Heap::NOT_IN_GC) {
      isolate()->PrintStack(&accumulator, Isolate::kPrintStackVerbose);
    } else {
      accumulator.Add("Cannot get stack trace in GC.");
    }

I'm guessing the stack trace fails because GC is moving objects around. 
Just wondering if there was any way to improve this, maybe update the stack 
pointers, or allow the GC to complete in some way. Thanks

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