| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 new_space_.CollectStatistics(); | 313 new_space_.CollectStatistics(); |
| 314 new_space_.ReportStatistics(); | 314 new_space_.ReportStatistics(); |
| 315 new_space_.ClearHistograms(); | 315 new_space_.ClearHistograms(); |
| 316 } | 316 } |
| 317 #endif // DEBUG | 317 #endif // DEBUG |
| 318 } | 318 } |
| 319 | 319 |
| 320 | 320 |
| 321 void Heap::PrintShortHeapStatistics() { | 321 void Heap::PrintShortHeapStatistics() { |
| 322 if (!FLAG_trace_gc_verbose) return; | 322 if (!FLAG_trace_gc_verbose) return; |
| 323 PrintF("Memory allocator, used: %8" V8_PTR_PREFIX "d" | 323 PrintF("Memory allocator, used: %6" V8_PTR_PREFIX "d KB" |
| 324 ", available: %8" V8_PTR_PREFIX "d\n", | 324 ", available: %6" V8_PTR_PREFIX "d KB\n", |
| 325 isolate_->memory_allocator()->Size(), | 325 isolate_->memory_allocator()->Size() / KB, |
| 326 isolate_->memory_allocator()->Available()); | 326 isolate_->memory_allocator()->Available() / KB); |
| 327 PrintF("New space, used: %8" V8_PTR_PREFIX "d" | 327 PrintF("New space, used: %6" V8_PTR_PREFIX "d KB" |
| 328 ", available: %8" V8_PTR_PREFIX "d\n", | 328 ", available: %6" V8_PTR_PREFIX "d KB" |
| 329 Heap::new_space_.Size(), | 329 ", committed: %6" V8_PTR_PREFIX "d KB\n", |
| 330 new_space_.Available()); | 330 new_space_.Size() / KB, |
| 331 PrintF("Old pointers, used: %8" V8_PTR_PREFIX "d" | 331 new_space_.Available() / KB, |
| 332 ", available: %8" V8_PTR_PREFIX "d" | 332 new_space_.CommittedMemory() / KB); |
| 333 ", waste: %8" V8_PTR_PREFIX "d\n", | 333 PrintF("Old pointers, used: %6" V8_PTR_PREFIX "d KB" |
| 334 old_pointer_space_->Size(), | 334 ", available: %6" V8_PTR_PREFIX "d KB" |
| 335 old_pointer_space_->Available(), | 335 ", committed: %6" V8_PTR_PREFIX "d KB\n", |
| 336 old_pointer_space_->Waste()); | 336 old_pointer_space_->SizeOfObjects() / KB, |
| 337 PrintF("Old data space, used: %8" V8_PTR_PREFIX "d" | 337 old_pointer_space_->Available() / KB, |
| 338 ", available: %8" V8_PTR_PREFIX "d" | 338 old_pointer_space_->CommittedMemory() / KB); |
| 339 ", waste: %8" V8_PTR_PREFIX "d\n", | 339 PrintF("Old data space, used: %6" V8_PTR_PREFIX "d KB" |
| 340 old_data_space_->Size(), | 340 ", available: %6" V8_PTR_PREFIX "d KB" |
| 341 old_data_space_->Available(), | 341 ", committed: %6" V8_PTR_PREFIX "d KB\n", |
| 342 old_data_space_->Waste()); | 342 old_data_space_->SizeOfObjects() / KB, |
| 343 PrintF("Code space, used: %8" V8_PTR_PREFIX "d" | 343 old_data_space_->Available() / KB, |
| 344 ", available: %8" V8_PTR_PREFIX "d" | 344 old_data_space_->CommittedMemory() / KB); |
| 345 ", waste: %8" V8_PTR_PREFIX "d\n", | 345 PrintF("Code space, used: %6" V8_PTR_PREFIX "d KB" |
| 346 code_space_->Size(), | 346 ", available: %6" V8_PTR_PREFIX "d KB" |
| 347 code_space_->Available(), | 347 ", committed: %6" V8_PTR_PREFIX "d KB\n", |
| 348 code_space_->Waste()); | 348 code_space_->SizeOfObjects() / KB, |
| 349 PrintF("Map space, used: %8" V8_PTR_PREFIX "d" | 349 code_space_->Available() / KB, |
| 350 ", available: %8" V8_PTR_PREFIX "d" | 350 code_space_->CommittedMemory() / KB); |
| 351 ", waste: %8" V8_PTR_PREFIX "d\n", | 351 PrintF("Map space, used: %6" V8_PTR_PREFIX "d KB" |
| 352 map_space_->Size(), | 352 ", available: %6" V8_PTR_PREFIX "d KB" |
| 353 map_space_->Available(), | 353 ", committed: %6" V8_PTR_PREFIX "d KB\n", |
| 354 map_space_->Waste()); | 354 map_space_->SizeOfObjects() / KB, |
| 355 PrintF("Cell space, used: %8" V8_PTR_PREFIX "d" | 355 map_space_->Available() / KB, |
| 356 ", available: %8" V8_PTR_PREFIX "d" | 356 map_space_->CommittedMemory() / KB); |
| 357 ", waste: %8" V8_PTR_PREFIX "d\n", | 357 PrintF("Cell space, used: %6" V8_PTR_PREFIX "d KB" |
| 358 cell_space_->Size(), | 358 ", available: %6" V8_PTR_PREFIX "d KB" |
| 359 cell_space_->Available(), | 359 ", committed: %6" V8_PTR_PREFIX "d KB\n", |
| 360 cell_space_->Waste()); | 360 cell_space_->SizeOfObjects() / KB, |
| 361 PrintF("Large object space, used: %8" V8_PTR_PREFIX "d" | 361 cell_space_->Available() / KB, |
| 362 ", available: %8" V8_PTR_PREFIX "d\n", | 362 cell_space_->CommittedMemory() / KB); |
| 363 lo_space_->Size(), | 363 PrintF("Large object space, used: %6" V8_PTR_PREFIX "d KB" |
| 364 lo_space_->Available()); | 364 ", available: %6" V8_PTR_PREFIX "d KB" |
| 365 ", committed: %6" V8_PTR_PREFIX "d KB\n", |
| 366 lo_space_->SizeOfObjects() / KB, |
| 367 lo_space_->Available() / KB, |
| 368 lo_space_->CommittedMemory() / KB); |
| 365 } | 369 } |
| 366 | 370 |
| 367 | 371 |
| 368 // TODO(1238405): Combine the infrastructure for --heap-stats and | 372 // TODO(1238405): Combine the infrastructure for --heap-stats and |
| 369 // --log-gc to avoid the complicated preprocessor and flag testing. | 373 // --log-gc to avoid the complicated preprocessor and flag testing. |
| 370 void Heap::ReportStatisticsAfterGC() { | 374 void Heap::ReportStatisticsAfterGC() { |
| 371 // Similar to the before GC, we use some complicated logic to ensure that | 375 // Similar to the before GC, we use some complicated logic to ensure that |
| 372 // NewSpace statistics are logged exactly once when --log-gc is turned on. | 376 // NewSpace statistics are logged exactly once when --log-gc is turned on. |
| 373 #if defined(DEBUG) | 377 #if defined(DEBUG) |
| 374 if (FLAG_heap_stats) { | 378 if (FLAG_heap_stats) { |
| (...skipping 6774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7149 } else { | 7153 } else { |
| 7150 p ^= 0x1d1ed & (Page::kPageSize - 1); // I died. | 7154 p ^= 0x1d1ed & (Page::kPageSize - 1); // I died. |
| 7151 } | 7155 } |
| 7152 remembered_unmapped_pages_[remembered_unmapped_pages_index_] = | 7156 remembered_unmapped_pages_[remembered_unmapped_pages_index_] = |
| 7153 reinterpret_cast<Address>(p); | 7157 reinterpret_cast<Address>(p); |
| 7154 remembered_unmapped_pages_index_++; | 7158 remembered_unmapped_pages_index_++; |
| 7155 remembered_unmapped_pages_index_ %= kRememberedUnmappedPages; | 7159 remembered_unmapped_pages_index_ %= kRememberedUnmappedPages; |
| 7156 } | 7160 } |
| 7157 | 7161 |
| 7158 } } // namespace v8::internal | 7162 } } // namespace v8::internal |
| OLD | NEW |