From 42afafedacdb7f002be5788105c9a20c2abe27b3 Mon Sep 17 00:00:00 2001 From: "kaanb@chromium.org" Date: Tue, 18 Jun 2013 12:11:28 +0000 Subject: Use 1/8 of heap size as TotalGpuMemory for low end devices. Also disabling async uploads if the heap size is less than 128MB as with async uploads the number of tiles grow unbounded without respecting the TotalGpuMemory. epenner and myself will investigate further. BUG=243703 Review URL: https://chromiumcodereview.appspot.com/16859003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206946 0039d316-1c4b-4281-b951-d872f2087c98 --- ui/gl/gl_context_android.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'ui/gl') diff --git a/ui/gl/gl_context_android.cc b/ui/gl/gl_context_android.cc index 552b055..1fe9416 100644 --- a/ui/gl/gl_context_android.cc +++ b/ui/gl/gl_context_android.cc @@ -89,10 +89,12 @@ bool GLContextEGL::GetTotalGpuMemory(size_t* bytes) { // end devices, 1/2 of the heap size can be too high, but this // correlates well with having a small heap-growth-limit. So for // devices with less ram, we factor in the growth limit. + // For devices with very limited memory, (e.g. Nexus S) we use + // 1/8 of the heap_size. // // This is the result of the calculation below: // Droid DNA 1080P 128MB - // Nexus S 56MB + // Nexus S 16MB // Galaxy Nexus 112MB // Nexus 4/10 256MB // Xoom 88MB @@ -103,9 +105,11 @@ bool GLContextEGL::GetTotalGpuMemory(size_t* bytes) { base::SysInfo::DalvikHeapGrowthLimitMB()); size_t limit = 0; if (heap_size >= 350) - limit = heap_size / 2; + limit = heap_size / 2; + else if (heap_size <= 128) + limit = heap_size / 8; else - limit = (heap_size + (heap_growth * 2)) / 4; + limit = (heap_size + (heap_growth * 2)) / 4; dalvik_limit = limit * 1024 * 1024; } *bytes = dalvik_limit; -- cgit v1.1