summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2016-09-20 14:47:08 +0300
committerGitHub <noreply@github.com>2016-09-20 14:47:08 +0300
commit34e783ed9cb52686ec61c67aa37054b3083ef66c (patch)
tree12cc22e9fc625300d0357d2f0dbfc7afe423247e /test
parent8b0694bc16c0a565c99691283df48b333aef5837 (diff)
downloadqtlocation-mapboxgl-34e783ed9cb52686ec61c67aa37054b3083ef66c.tar.gz
[tests] Remove memory fragmentation test (#6226)
It is not reliable.
Diffstat (limited to 'test')
-rw-r--r--test/util/memory.cpp62
1 files changed, 0 insertions, 62 deletions
diff --git a/test/util/memory.cpp b/test/util/memory.cpp
index bc20200916..d1b9f2412a 100644
--- a/test/util/memory.cpp
+++ b/test/util/memory.cpp
@@ -107,68 +107,6 @@ TEST(Memory, Raster) {
test::render(map);
}
-// This test will render 3 map objects alternating
-// between a raster and a vector style. Memory is
-// expected to grow between the renderings due to
-// fragmentation. A good allocator for Mapbox GL
-// Native will keep memory growth within acceptable
-// levels and stable in the long run.
-TEST(Memory, Fragmentation) {
- if (!isUsingJemalloc()) {
- return;
- }
-
- MemoryTest test;
-
- Map map1(test.view, test.fileSource, MapMode::Still);
- Map map2(test.view, test.fileSource, MapMode::Still);
- Map map3(test.view, test.fileSource, MapMode::Still);
-
- map1.setZoom(16);
- map2.setZoom(16);
- map3.setZoom(16);
-
- auto renderMap = [&] {
- map1.setStyleURL("mapbox://satellite");
- test::render(map1);
-
- map2.setStyleURL("mapbox://satellite");
- test::render(map2);
-
- map3.setStyleURL("mapbox://satellite");
- test::render(map3);
-
- map1.setStyleURL("mapbox://streets");
- test::render(map1);
-
- map2.setStyleURL("mapbox://streets");
- test::render(map2);
-
- map3.setStyleURL("mapbox://streets");
- test::render(map3);
- };
-
- // Warm up buffers and cache.
- for (unsigned i = 0; i < 5; ++i) {
- renderMap();
- }
-
- long lastRSS = getRSS();
- long memoryFragments = 0;
-
- for (unsigned i = 0; i < 20; ++i) {
- renderMap();
-
- long currentRSS = getRSS();
-
- memoryFragments += currentRSS - lastRSS;
- lastRSS = currentRSS;
- }
-
- ASSERT_LT(memoryFragments, 10 * 1024 * 1024) << "\
- Abnormal memory growth detected.";
-}
-
// This test will measure the size of a Map object
// after rendering a raster and a vector style. The
// idea is to try to keep the memory footprint within