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 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 return judgeGCThreshold(1024 * 1024, 1.5); | 563 return judgeGCThreshold(1024 * 1024, 1.5); |
564 } | 564 } |
565 | 565 |
566 bool ThreadState::shouldScheduleV8FollowupGC() | 566 bool ThreadState::shouldScheduleV8FollowupGC() |
567 { | 567 { |
568 return judgeGCThreshold(32 * 1024 * 1024, 1.5); | 568 return judgeGCThreshold(32 * 1024 * 1024, 1.5); |
569 } | 569 } |
570 | 570 |
571 bool ThreadState::shouldSchedulePageNavigationGC(float estimatedRemovalRatio) | 571 bool ThreadState::shouldSchedulePageNavigationGC(float estimatedRemovalRatio) |
572 { | 572 { |
573 // TODO(keishi): Temporarily disabled to observe impact. crbug.com/588029 | 573 // If estimatedRemovalRatio is low we should let IdleGC handle this. |
574 return false; | 574 if (estimatedRemovalRatio < 0.01) |
| 575 return false; |
| 576 return judgeGCThreshold(32 * 1024 * 1024, 1.5 * (1 - estimatedRemovalRatio))
; |
575 } | 577 } |
576 | 578 |
577 bool ThreadState::shouldForceConservativeGC() | 579 bool ThreadState::shouldForceConservativeGC() |
578 { | 580 { |
579 // TODO(haraken): 400% is too large. Lower the heap growing factor. | 581 // TODO(haraken): 400% is too large. Lower the heap growing factor. |
580 return judgeGCThreshold(32 * 1024 * 1024, 5.0); | 582 return judgeGCThreshold(32 * 1024 * 1024, 5.0); |
581 } | 583 } |
582 | 584 |
583 // If we're consuming too much memory, trigger a conservative GC | 585 // If we're consuming too much memory, trigger a conservative GC |
584 // aggressively. This is a safe guard to avoid OOM. | 586 // aggressively. This is a safe guard to avoid OOM. |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 dataLogF("Scheduled MemoryPressureGC\n"); | 663 dataLogF("Scheduled MemoryPressureGC\n"); |
662 #endif | 664 #endif |
663 Heap::collectGarbage(BlinkGC::HeapPointersOnStack, BlinkGC::GCWithoutSwe
ep, BlinkGC::MemoryPressureGC); | 665 Heap::collectGarbage(BlinkGC::HeapPointersOnStack, BlinkGC::GCWithoutSwe
ep, BlinkGC::MemoryPressureGC); |
664 return; | 666 return; |
665 } | 667 } |
666 if (shouldSchedulePageNavigationGC(estimatedRemovalRatio)) { | 668 if (shouldSchedulePageNavigationGC(estimatedRemovalRatio)) { |
667 #if PRINT_HEAP_STATS | 669 #if PRINT_HEAP_STATS |
668 dataLogF("Scheduled PageNavigationGC\n"); | 670 dataLogF("Scheduled PageNavigationGC\n"); |
669 #endif | 671 #endif |
670 schedulePageNavigationGC(); | 672 schedulePageNavigationGC(); |
671 return; | |
672 } | 673 } |
673 } | 674 } |
674 | 675 |
675 void ThreadState::schedulePageNavigationGC() | 676 void ThreadState::schedulePageNavigationGC() |
676 { | 677 { |
677 ASSERT(checkThread()); | 678 ASSERT(checkThread()); |
678 ASSERT(!isSweepingInProgress()); | 679 ASSERT(!isSweepingInProgress()); |
679 setGCState(PageNavigationGCScheduled); | 680 setGCState(PageNavigationGCScheduled); |
680 } | 681 } |
681 | 682 |
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1533 threadDump->addScalar("dead_count", "objects", totalDeadCount); | 1534 threadDump->addScalar("dead_count", "objects", totalDeadCount); |
1534 threadDump->addScalar("live_size", "bytes", totalLiveSize); | 1535 threadDump->addScalar("live_size", "bytes", totalLiveSize); |
1535 threadDump->addScalar("dead_size", "bytes", totalDeadSize); | 1536 threadDump->addScalar("dead_size", "bytes", totalDeadSize); |
1536 | 1537 |
1537 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c
reateMemoryAllocatorDumpForCurrentGC(heapsDumpName); | 1538 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c
reateMemoryAllocatorDumpForCurrentGC(heapsDumpName); |
1538 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()-
>createMemoryAllocatorDumpForCurrentGC(classesDumpName); | 1539 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()-
>createMemoryAllocatorDumpForCurrentGC(classesDumpName); |
1539 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners
hipEdge(classesDump->guid(), heapsDump->guid()); | 1540 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners
hipEdge(classesDump->guid(), heapsDump->guid()); |
1540 } | 1541 } |
1541 | 1542 |
1542 } // namespace blink | 1543 } // namespace blink |
OLD | NEW |