| Index: runtime/vm/pages.h
|
| ===================================================================
|
| --- runtime/vm/pages.h (revision 35208)
|
| +++ runtime/vm/pages.h (working copy)
|
| @@ -95,6 +95,8 @@
|
|
|
| int GarbageCollectionTimeFraction();
|
|
|
| + bool IsEmpty() const { return index_ == 0; }
|
| +
|
| private:
|
| static const intptr_t kHistoryLength = 4;
|
| int64_t start_[kHistoryLength];
|
| @@ -106,14 +108,11 @@
|
| };
|
|
|
|
|
| -// If GC is able to reclaim more than heap_growth_ratio (in percent) memory
|
| -// and if the relative GC time is below a given threshold,
|
| -// then the heap is not grown when the next GC decision is made.
|
| // PageSpaceController controls the heap size.
|
| class PageSpaceController {
|
| public:
|
| PageSpaceController(int heap_growth_ratio,
|
| - int heap_growth_rate,
|
| + int heap_growth_max,
|
| int garbage_collection_time_ratio);
|
| ~PageSpaceController();
|
|
|
| @@ -123,10 +122,6 @@
|
| bool NeedsGarbageCollection(SpaceUsage after) const;
|
|
|
| // Should be called after each collection to update the controller state.
|
| - // A garbage collection is considered as successful if more than
|
| - // heap_growth_ratio % of memory got deallocated by the garbage collector.
|
| - // In this case garbage collection will be performed next time. Otherwise
|
| - // the heap will grow.
|
| void EvaluateGarbageCollection(SpaceUsage before,
|
| SpaceUsage after,
|
| int64_t start, int64_t end);
|
| @@ -164,11 +159,11 @@
|
| // Equivalent to \frac{100-heap_growth_ratio_}{100}.
|
| double desired_utilization_;
|
|
|
| - // Number of pages we grow.
|
| - int heap_growth_rate_;
|
| + // Max number of pages we grow.
|
| + int heap_growth_max_;
|
|
|
| - // If the relative GC time stays below garbage_collection_time_ratio_
|
| - // garbage collection can be performed.
|
| + // If the relative GC time goes above garbage_collection_time_ratio_ %,
|
| + // we grow the heap more aggressively.
|
| int garbage_collection_time_ratio_;
|
|
|
| // The time in microseconds of the last time we tried to collect unused
|
|
|