From: Ilkka Saarelainen Date: Tue, 29 Mar 2022 10:30:06 +0000 (+0300) Subject: Reduce advertised sys mem on 32 bit Android X-Git-Tag: upstream/1.3.5~332^2^2~3^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2570b82dbb2d5620256ef87d78046d710f30fe49;p=platform%2Fupstream%2FVK-GL-CTS.git Reduce advertised sys mem on 32 bit Android This CL reduces the advertised system memory amount in 32 bit Android builds to address some memory fragmentation issues in certain tests that rely on the advertised memory amount. Affects: dEQP-VK.api.buffer.suballocation.* dEQP-VK.api.buffer.dedicated_alloc.* dEQP-VK.api.object_management.* dEQP-VK.memory.allocation.* dEQP-VK.memory.device_group_allocation.* dEQP-VK.pipeline.render_to_image.*.small.* dEQP-VK.pipeline.render_to_image.*.huge.* Components: Framework, Vulkan VK-GL-CTS issue: 3586 Change-Id: I15ef027e3f69ddbb87e8704d0cff479782b6bda6 --- diff --git a/framework/platform/android/tcuAndroidPlatform.cpp b/framework/platform/android/tcuAndroidPlatform.cpp index f671854..a78d832 100644 --- a/framework/platform/android/tcuAndroidPlatform.cpp +++ b/framework/platform/android/tcuAndroidPlatform.cpp @@ -337,7 +337,20 @@ void Platform::getMemoryLimits (vk::PlatformMemoryLimits& limits) const // Worst-case estimates const size_t MiB = (size_t)(1<<20); const size_t baseMemUsage = 400*MiB; + +#if (DE_PTR_SIZE == 4) + // Some tests, such as: + // + // dEQP-VK.api.object_management.max_concurrent.* + // dEQP-VK.memory.allocation.random.* + // + // when run in succession, can lead to system memory fragmentation. It depends on the allocator, and on some 32-bit + // systems can lead to out of memory errors. As a workaround, we use a smaller amount of memory on 32-bit systems, + // as this typically avoids out of memory errors caused by fragmentation. + const double safeUsageRatio = 0.1; +#else const double safeUsageRatio = 0.25; +#endif limits.totalSystemMemory = de::max((size_t)(double(deInt64(m_totalSystemMemory)-deInt64(baseMemUsage)) * safeUsageRatio), 16*MiB);