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 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 { | 652 { |
653 #if ENABLE(IDLE_GC) | 653 #if ENABLE(IDLE_GC) |
654 return false; | 654 return false; |
655 #else | 655 #else |
656 return judgeGCThreshold(1024 * 1024, 1.5); | 656 return judgeGCThreshold(1024 * 1024, 1.5); |
657 #endif | 657 #endif |
658 } | 658 } |
659 | 659 |
660 bool ThreadState::shouldSchedulePageNavigationGC(float estimatedRemovalRatio) | 660 bool ThreadState::shouldSchedulePageNavigationGC(float estimatedRemovalRatio) |
661 { | 661 { |
662 return judgeGCThreshold(1024 * 1024, 1.5); | 662 return judgeGCThreshold(1024 * 1024, 1.5 * (1 - estimatedRemovalRatio)); |
663 } | 663 } |
664 | 664 |
665 bool ThreadState::shouldForceConservativeGC() | 665 bool ThreadState::shouldForceConservativeGC() |
666 { | 666 { |
667 // TODO(haraken): 400% is too large. Lower the heap growing factor. | 667 // TODO(haraken): 400% is too large. Lower the heap growing factor. |
668 return judgeGCThreshold(32 * 1024 * 1024, 5.0); | 668 return judgeGCThreshold(32 * 1024 * 1024, 5.0); |
669 } | 669 } |
670 | 670 |
671 void ThreadState::schedulePageNavigationGCIfNeeded(float estimatedRemovalRatio) | 671 void ThreadState::schedulePageNavigationGCIfNeeded(float estimatedRemovalRatio) |
672 { | 672 { |
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1583 json->beginArray(it->key.ascii().data()); | 1583 json->beginArray(it->key.ascii().data()); |
1584 for (size_t age = 0; age <= maxHeapObjectAge; ++age) | 1584 for (size_t age = 0; age <= maxHeapObjectAge; ++age) |
1585 json->pushInteger(it->value.ages[age]); | 1585 json->pushInteger(it->value.ages[age]); |
1586 json->endArray(); | 1586 json->endArray(); |
1587 } | 1587 } |
1588 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("blink_gc"), s
tatsName, this, json.release()); | 1588 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("blink_gc"), s
tatsName, this, json.release()); |
1589 } | 1589 } |
1590 #endif | 1590 #endif |
1591 | 1591 |
1592 } // namespace blink | 1592 } // namespace blink |
OLD | NEW |