From 0163a0e8dc6020c614b58fcba2e20141c9d6e162 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Tue, 23 Apr 2019 13:25:08 -0700 Subject: [PATCH] Increase the memory usage estimate for EngineLayer (flutter/engine#8700) EngineLayers can hold references to Skia objects and may consume significant resources. This change will result in more aggressive cleanup of EngineLayers by the Dart GC. See https://github.com/flutter/flutter/issues/31303 --- engine/src/flutter/lib/ui/painting/engine_layer.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/lib/ui/painting/engine_layer.cc b/engine/src/flutter/lib/ui/painting/engine_layer.cc index 7ac9c98497..c10c493e7f 100644 --- a/engine/src/flutter/lib/ui/painting/engine_layer.cc +++ b/engine/src/flutter/lib/ui/painting/engine_layer.cc @@ -24,7 +24,9 @@ size_t EngineLayer::GetAllocationSize() { // Provide an approximation of the total memory impact of this object to the // Dart GC. The ContainerLayer may hold references to a tree of other layers, // which in turn may contain Skia objects. - return 3000; + // TODO(https://github.com/flutter/flutter/issues/31498): calculate the cost + // of the layer more accurately. + return 200000; }; IMPLEMENT_WRAPPERTYPEINFO(ui, EngineLayer);