Add flag to trace the amount of external memory.

R=yangguo@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10824196

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12269 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
ulan@chromium.org 2012-08-07 14:17:35 +00:00
parent 5deec59302
commit fb7345cdfd
2 changed files with 10 additions and 0 deletions

View File

@ -370,6 +370,9 @@ DEFINE_bool(trace_gc_verbose, false,
"print more details following each garbage collection")
DEFINE_bool(trace_fragmentation, false,
"report fragmentation for old pointer and data pages")
DEFINE_bool(trace_external_memory, false,
"print amount of external allocated memory after each time "
"it is adjusted.")
DEFINE_bool(collect_maps, true,
"garbage collect maps from which no objects can be reached")
DEFINE_bool(flush_code, true,

View File

@ -487,6 +487,13 @@ intptr_t Heap::AdjustAmountOfExternalAllocatedMemory(
amount_of_external_allocated_memory_at_last_global_gc_ = 0;
}
}
if (FLAG_trace_external_memory) {
PrintPID("%8.0f ms: ", isolate()->time_millis_since_init());
PrintF("Adjust amount of external memory: delta=%6" V8_PTR_PREFIX "d KB, "
" amount=%6" V8_PTR_PREFIX "d KB, isolate=0x%08" V8PRIxPTR ".\n",
change_in_bytes / 1024, amount_of_external_allocated_memory_ / 1024,
reinterpret_cast<intptr_t>(isolate()));
}
ASSERT(amount_of_external_allocated_memory_ >= 0);
return amount_of_external_allocated_memory_;
}