OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
590 | 590 |
591 if (isGCForbidden()) | 591 if (isGCForbidden()) |
592 return; | 592 return; |
593 | 593 |
594 // This completeSweep() will do nothing in common cases since we've | 594 // This completeSweep() will do nothing in common cases since we've |
595 // called completeSweep() before V8 starts minor/major GCs. | 595 // called completeSweep() before V8 starts minor/major GCs. |
596 completeSweep(); | 596 completeSweep(); |
597 ASSERT(!isSweepingInProgress()); | 597 ASSERT(!isSweepingInProgress()); |
598 ASSERT(!sweepForbidden()); | 598 ASSERT(!sweepForbidden()); |
599 | 599 |
600 // TODO(haraken): Consider if we should trigger a memory pressure GC | 600 if ((gcType == BlinkGC::V8MajorGC && shouldForceMemoryPressureGC()) |
sof
2016/02/01 14:41:48
Won't this regress on some tests that do run into
haraken
2016/02/01 15:05:57
It may regress, but I think it isn't as terrible a
| |
601 // for V8 minor GCs as well. | 601 || shouldScheduleV8FollowupGC()) { |
602 if (gcType == BlinkGC::V8MajorGC && shouldForceMemoryPressureGC()) { | |
603 #if PRINT_HEAP_STATS | |
604 dataLogF("Scheduled MemoryPressureGC\n"); | |
605 #endif | |
606 Heap::collectGarbage(BlinkGC::HeapPointersOnStack, BlinkGC::GCWithoutSwe ep, BlinkGC::MemoryPressureGC); | |
607 return; | |
608 } | |
609 if (shouldScheduleV8FollowupGC()) { | |
610 #if PRINT_HEAP_STATS | 602 #if PRINT_HEAP_STATS |
611 dataLogF("Scheduled PreciseGC\n"); | 603 dataLogF("Scheduled PreciseGC\n"); |
612 #endif | 604 #endif |
613 schedulePreciseGC(); | 605 schedulePreciseGC(); |
614 return; | 606 return; |
615 } | 607 } |
616 if (gcType == BlinkGC::V8MajorGC) { | 608 if (gcType == BlinkGC::V8MajorGC) { |
617 #if PRINT_HEAP_STATS | 609 #if PRINT_HEAP_STATS |
618 dataLogF("Scheduled IdleGC\n"); | 610 dataLogF("Scheduled IdleGC\n"); |
619 #endif | 611 #endif |
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1507 threadDump->addScalar("dead_count", "objects", totalDeadCount); | 1499 threadDump->addScalar("dead_count", "objects", totalDeadCount); |
1508 threadDump->addScalar("live_size", "bytes", totalLiveSize); | 1500 threadDump->addScalar("live_size", "bytes", totalLiveSize); |
1509 threadDump->addScalar("dead_size", "bytes", totalDeadSize); | 1501 threadDump->addScalar("dead_size", "bytes", totalDeadSize); |
1510 | 1502 |
1511 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c reateMemoryAllocatorDumpForCurrentGC(heapsDumpName); | 1503 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c reateMemoryAllocatorDumpForCurrentGC(heapsDumpName); |
1512 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()- >createMemoryAllocatorDumpForCurrentGC(classesDumpName); | 1504 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()- >createMemoryAllocatorDumpForCurrentGC(classesDumpName); |
1513 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners hipEdge(classesDump->guid(), heapsDump->guid()); | 1505 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners hipEdge(classesDump->guid(), heapsDump->guid()); |
1514 } | 1506 } |
1515 | 1507 |
1516 } // namespace blink | 1508 } // namespace blink |
OLD | NEW |