space_test.h revision a7433515114ae725c3427cd510f76b84107170a1
1/* 2 * Copyright (C) 2011 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17#ifndef ART_RUNTIME_GC_SPACE_SPACE_TEST_H_ 18#define ART_RUNTIME_GC_SPACE_SPACE_TEST_H_ 19 20#include "zygote_space.h" 21 22#include "common_test.h" 23#include "globals.h" 24#include "UniquePtr.h" 25#include "mirror/array-inl.h" 26#include "mirror/object-inl.h" 27 28#include <stdint.h> 29 30namespace art { 31namespace gc { 32namespace space { 33 34class SpaceTest : public CommonTest { 35 public: 36 void AddSpace(ContinuousSpace* space) { 37 // For RosAlloc, revoke the thread local runs before moving onto a 38 // new alloc space. 39 Runtime::Current()->GetHeap()->RevokeAllThreadLocalBuffers(); 40 Runtime::Current()->GetHeap()->AddSpace(space); 41 } 42 void InstallClass(SirtRef<mirror::Object>& o, size_t size) 43 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { 44 // Note the minimum size, which is the size of a zero-length byte array. 45 EXPECT_GE(size, SizeOfZeroLengthByteArray()); 46 SirtRef<mirror::ClassLoader> null_loader(Thread::Current(), nullptr); 47 mirror::Class* byte_array_class = Runtime::Current()->GetClassLinker()->FindClass("[B", 48 null_loader); 49 EXPECT_TRUE(byte_array_class != nullptr); 50 o->SetClass(byte_array_class); 51 mirror::Array* arr = o->AsArray<kVerifyNone>(); 52 size_t header_size = SizeOfZeroLengthByteArray(); 53 int32_t length = size - header_size; 54 arr->SetLength(length); 55 EXPECT_EQ(arr->SizeOf<kVerifyNone>(), size); 56 } 57 58 static size_t SizeOfZeroLengthByteArray() { 59 return mirror::Array::DataOffset(Primitive::ComponentSize(Primitive::kPrimByte)).Uint32Value(); 60 } 61 62 typedef MallocSpace* (*CreateSpaceFn)(const std::string& name, size_t initial_size, size_t growth_limit, 63 size_t capacity, byte* requested_begin); 64 void InitTestBody(CreateSpaceFn create_space); 65 void ZygoteSpaceTestBody(CreateSpaceFn create_space); 66 void AllocAndFreeTestBody(CreateSpaceFn create_space); 67 void AllocAndFreeListTestBody(CreateSpaceFn create_space); 68 69 void SizeFootPrintGrowthLimitAndTrimBody(MallocSpace* space, intptr_t object_size, 70 int round, size_t growth_limit); 71 void SizeFootPrintGrowthLimitAndTrimDriver(size_t object_size, CreateSpaceFn create_space); 72}; 73 74static size_t test_rand(size_t* seed) { 75 *seed = *seed * 1103515245 + 12345; 76 return *seed; 77} 78 79void SpaceTest::InitTestBody(CreateSpaceFn create_space) { 80 { 81 // Init < max == growth 82 UniquePtr<Space> space(create_space("test", 16 * MB, 32 * MB, 32 * MB, nullptr)); 83 EXPECT_TRUE(space.get() != nullptr); 84 } 85 { 86 // Init == max == growth 87 UniquePtr<Space> space(create_space("test", 16 * MB, 16 * MB, 16 * MB, nullptr)); 88 EXPECT_TRUE(space.get() != nullptr); 89 } 90 { 91 // Init > max == growth 92 UniquePtr<Space> space(create_space("test", 32 * MB, 16 * MB, 16 * MB, nullptr)); 93 EXPECT_TRUE(space.get() == nullptr); 94 } 95 { 96 // Growth == init < max 97 UniquePtr<Space> space(create_space("test", 16 * MB, 16 * MB, 32 * MB, nullptr)); 98 EXPECT_TRUE(space.get() != nullptr); 99 } 100 { 101 // Growth < init < max 102 UniquePtr<Space> space(create_space("test", 16 * MB, 8 * MB, 32 * MB, nullptr)); 103 EXPECT_TRUE(space.get() == nullptr); 104 } 105 { 106 // Init < growth < max 107 UniquePtr<Space> space(create_space("test", 8 * MB, 16 * MB, 32 * MB, nullptr)); 108 EXPECT_TRUE(space.get() != nullptr); 109 } 110 { 111 // Init < max < growth 112 UniquePtr<Space> space(create_space("test", 8 * MB, 32 * MB, 16 * MB, nullptr)); 113 EXPECT_TRUE(space.get() == nullptr); 114 } 115} 116 117// TODO: This test is not very good, we should improve it. 118// The test should do more allocations before the creation of the ZygoteSpace, and then do 119// allocations after the ZygoteSpace is created. The test should also do some GCs to ensure that 120// the GC works with the ZygoteSpace. 121void SpaceTest::ZygoteSpaceTestBody(CreateSpaceFn create_space) { 122 size_t dummy = 0; 123 MallocSpace* space(create_space("test", 4 * MB, 16 * MB, 16 * MB, nullptr)); 124 ASSERT_TRUE(space != nullptr); 125 126 // Make space findable to the heap, will also delete space when runtime is cleaned up 127 AddSpace(space); 128 Thread* self = Thread::Current(); 129 ScopedObjectAccess soa(self); 130 131 // Succeeds, fits without adjusting the footprint limit. 132 SirtRef<mirror::Object> ptr1(self, space->Alloc(self, 1 * MB, &dummy)); 133 EXPECT_TRUE(ptr1.get() != nullptr); 134 InstallClass(ptr1, 1 * MB); 135 136 // Fails, requires a higher footprint limit. 137 mirror::Object* ptr2 = space->Alloc(self, 8 * MB, &dummy); 138 EXPECT_TRUE(ptr2 == nullptr); 139 140 // Succeeds, adjusts the footprint. 141 size_t ptr3_bytes_allocated; 142 SirtRef<mirror::Object> ptr3(self, space->AllocWithGrowth(self, 8 * MB, &ptr3_bytes_allocated)); 143 EXPECT_TRUE(ptr3.get() != nullptr); 144 EXPECT_LE(8U * MB, ptr3_bytes_allocated); 145 InstallClass(ptr3, 8 * MB); 146 147 // Fails, requires a higher footprint limit. 148 mirror::Object* ptr4 = space->Alloc(self, 8 * MB, &dummy); 149 EXPECT_TRUE(ptr4 == nullptr); 150 151 // Also fails, requires a higher allowed footprint. 152 mirror::Object* ptr5 = space->AllocWithGrowth(self, 8 * MB, &dummy); 153 EXPECT_TRUE(ptr5 == nullptr); 154 155 // Release some memory. 156 size_t free3 = space->AllocationSize(ptr3.get()); 157 EXPECT_EQ(free3, ptr3_bytes_allocated); 158 EXPECT_EQ(free3, space->Free(self, ptr3.reset(nullptr))); 159 EXPECT_LE(8U * MB, free3); 160 161 // Succeeds, now that memory has been freed. 162 SirtRef<mirror::Object> ptr6(self, space->AllocWithGrowth(self, 9 * MB, &dummy)); 163 EXPECT_TRUE(ptr6.get() != nullptr); 164 InstallClass(ptr6, 9 * MB); 165 166 // Final clean up. 167 size_t free1 = space->AllocationSize(ptr1.get()); 168 space->Free(self, ptr1.reset(nullptr)); 169 EXPECT_LE(1U * MB, free1); 170 171 // Make sure that the zygote space isn't directly at the start of the space. 172 space->Alloc(self, 1U * MB, &dummy); 173 174 gc::Heap* heap = Runtime::Current()->GetHeap(); 175 space::Space* old_space = space; 176 heap->RemoveSpace(old_space); 177 space::ZygoteSpace* zygote_space = space->CreateZygoteSpace("alloc space", 178 heap->IsLowMemoryMode(), 179 &space); 180 delete old_space; 181 // Add the zygote space. 182 AddSpace(zygote_space); 183 184 // Make space findable to the heap, will also delete space when runtime is cleaned up 185 AddSpace(space); 186 187 // Succeeds, fits without adjusting the footprint limit. 188 ptr1.reset(space->Alloc(self, 1 * MB, &dummy)); 189 EXPECT_TRUE(ptr1.get() != nullptr); 190 InstallClass(ptr1, 1 * MB); 191 192 // Fails, requires a higher footprint limit. 193 ptr2 = space->Alloc(self, 8 * MB, &dummy); 194 EXPECT_TRUE(ptr2 == nullptr); 195 196 // Succeeds, adjusts the footprint. 197 ptr3.reset(space->AllocWithGrowth(self, 2 * MB, &dummy)); 198 EXPECT_TRUE(ptr3.get() != nullptr); 199 InstallClass(ptr3, 2 * MB); 200 space->Free(self, ptr3.reset(nullptr)); 201 202 // Final clean up. 203 free1 = space->AllocationSize(ptr1.get()); 204 space->Free(self, ptr1.reset(nullptr)); 205 EXPECT_LE(1U * MB, free1); 206} 207 208void SpaceTest::AllocAndFreeTestBody(CreateSpaceFn create_space) { 209 size_t dummy = 0; 210 MallocSpace* space(create_space("test", 4 * MB, 16 * MB, 16 * MB, nullptr)); 211 ASSERT_TRUE(space != nullptr); 212 Thread* self = Thread::Current(); 213 ScopedObjectAccess soa(self); 214 215 // Make space findable to the heap, will also delete space when runtime is cleaned up 216 AddSpace(space); 217 218 // Succeeds, fits without adjusting the footprint limit. 219 SirtRef<mirror::Object> ptr1(self, space->Alloc(self, 1 * MB, &dummy)); 220 EXPECT_TRUE(ptr1.get() != nullptr); 221 InstallClass(ptr1, 1 * MB); 222 223 // Fails, requires a higher footprint limit. 224 mirror::Object* ptr2 = space->Alloc(self, 8 * MB, &dummy); 225 EXPECT_TRUE(ptr2 == nullptr); 226 227 // Succeeds, adjusts the footprint. 228 size_t ptr3_bytes_allocated; 229 SirtRef<mirror::Object> ptr3(self, space->AllocWithGrowth(self, 8 * MB, &ptr3_bytes_allocated)); 230 EXPECT_TRUE(ptr3.get() != nullptr); 231 EXPECT_LE(8U * MB, ptr3_bytes_allocated); 232 InstallClass(ptr3, 8 * MB); 233 234 // Fails, requires a higher footprint limit. 235 mirror::Object* ptr4 = space->Alloc(self, 8 * MB, &dummy); 236 EXPECT_TRUE(ptr4 == nullptr); 237 238 // Also fails, requires a higher allowed footprint. 239 mirror::Object* ptr5 = space->AllocWithGrowth(self, 8 * MB, &dummy); 240 EXPECT_TRUE(ptr5 == nullptr); 241 242 // Release some memory. 243 size_t free3 = space->AllocationSize(ptr3.get()); 244 EXPECT_EQ(free3, ptr3_bytes_allocated); 245 space->Free(self, ptr3.reset(nullptr)); 246 EXPECT_LE(8U * MB, free3); 247 248 // Succeeds, now that memory has been freed. 249 SirtRef<mirror::Object> ptr6(self, space->AllocWithGrowth(self, 9 * MB, &dummy)); 250 EXPECT_TRUE(ptr6.get() != nullptr); 251 InstallClass(ptr6, 9 * MB); 252 253 // Final clean up. 254 size_t free1 = space->AllocationSize(ptr1.get()); 255 space->Free(self, ptr1.reset(nullptr)); 256 EXPECT_LE(1U * MB, free1); 257} 258 259void SpaceTest::AllocAndFreeListTestBody(CreateSpaceFn create_space) { 260 MallocSpace* space(create_space("test", 4 * MB, 16 * MB, 16 * MB, nullptr)); 261 ASSERT_TRUE(space != nullptr); 262 263 // Make space findable to the heap, will also delete space when runtime is cleaned up 264 AddSpace(space); 265 Thread* self = Thread::Current(); 266 ScopedObjectAccess soa(self); 267 268 // Succeeds, fits without adjusting the max allowed footprint. 269 mirror::Object* lots_of_objects[1024]; 270 for (size_t i = 0; i < arraysize(lots_of_objects); i++) { 271 size_t allocation_size = 0; 272 size_t size_of_zero_length_byte_array = SizeOfZeroLengthByteArray(); 273 lots_of_objects[i] = space->Alloc(self, size_of_zero_length_byte_array, &allocation_size); 274 EXPECT_TRUE(lots_of_objects[i] != nullptr); 275 SirtRef<mirror::Object> obj(self, lots_of_objects[i]); 276 InstallClass(obj, size_of_zero_length_byte_array); 277 lots_of_objects[i] = obj.get(); 278 EXPECT_EQ(allocation_size, space->AllocationSize(lots_of_objects[i])); 279 } 280 281 // Release memory and check pointers are nullptr. 282 space->FreeList(self, arraysize(lots_of_objects), lots_of_objects); 283 for (size_t i = 0; i < arraysize(lots_of_objects); i++) { 284 EXPECT_TRUE(lots_of_objects[i] == nullptr); 285 } 286 287 // Succeeds, fits by adjusting the max allowed footprint. 288 for (size_t i = 0; i < arraysize(lots_of_objects); i++) { 289 size_t allocation_size = 0; 290 lots_of_objects[i] = space->AllocWithGrowth(self, 1024, &allocation_size); 291 EXPECT_TRUE(lots_of_objects[i] != nullptr); 292 SirtRef<mirror::Object> obj(self, lots_of_objects[i]); 293 InstallClass(obj, 1024); 294 lots_of_objects[i] = obj.get(); 295 EXPECT_EQ(allocation_size, space->AllocationSize(lots_of_objects[i])); 296 } 297 298 // Release memory and check pointers are nullptr 299 // TODO: This isn't compaction safe, fix. 300 space->FreeList(self, arraysize(lots_of_objects), lots_of_objects); 301 for (size_t i = 0; i < arraysize(lots_of_objects); i++) { 302 EXPECT_TRUE(lots_of_objects[i] == nullptr); 303 } 304} 305 306void SpaceTest::SizeFootPrintGrowthLimitAndTrimBody(MallocSpace* space, intptr_t object_size, 307 int round, size_t growth_limit) { 308 if (((object_size > 0 && object_size >= static_cast<intptr_t>(growth_limit))) || 309 ((object_size < 0 && -object_size >= static_cast<intptr_t>(growth_limit)))) { 310 // No allocation can succeed 311 return; 312 } 313 314 // The space's footprint equals amount of resources requested from system 315 size_t footprint = space->GetFootprint(); 316 317 // The space must at least have its book keeping allocated 318 EXPECT_GT(footprint, 0u); 319 320 // But it shouldn't exceed the initial size 321 EXPECT_LE(footprint, growth_limit); 322 323 // space's size shouldn't exceed the initial size 324 EXPECT_LE(space->Size(), growth_limit); 325 326 // this invariant should always hold or else the space has grown to be larger than what the 327 // space believes its size is (which will break invariants) 328 EXPECT_GE(space->Size(), footprint); 329 330 // Fill the space with lots of small objects up to the growth limit 331 size_t max_objects = (growth_limit / (object_size > 0 ? object_size : 8)) + 1; 332 UniquePtr<mirror::Object*[]> lots_of_objects(new mirror::Object*[max_objects]); 333 size_t last_object = 0; // last object for which allocation succeeded 334 size_t amount_allocated = 0; // amount of space allocated 335 Thread* self = Thread::Current(); 336 ScopedObjectAccess soa(self); 337 size_t rand_seed = 123456789; 338 for (size_t i = 0; i < max_objects; i++) { 339 size_t alloc_fails = 0; // number of failed allocations 340 size_t max_fails = 30; // number of times we fail allocation before giving up 341 for (; alloc_fails < max_fails; alloc_fails++) { 342 size_t alloc_size; 343 if (object_size > 0) { 344 alloc_size = object_size; 345 } else { 346 alloc_size = test_rand(&rand_seed) % static_cast<size_t>(-object_size); 347 // Note the minimum size, which is the size of a zero-length byte array. 348 size_t size_of_zero_length_byte_array = SizeOfZeroLengthByteArray(); 349 if (alloc_size < size_of_zero_length_byte_array) { 350 alloc_size = size_of_zero_length_byte_array; 351 } 352 } 353 SirtRef<mirror::Object> object(self, nullptr); 354 size_t bytes_allocated = 0; 355 if (round <= 1) { 356 object.reset(space->Alloc(self, alloc_size, &bytes_allocated)); 357 } else { 358 object.reset(space->AllocWithGrowth(self, alloc_size, &bytes_allocated)); 359 } 360 footprint = space->GetFootprint(); 361 EXPECT_GE(space->Size(), footprint); // invariant 362 if (object.get() != nullptr) { // allocation succeeded 363 InstallClass(object, alloc_size); 364 lots_of_objects[i] = object.get(); 365 size_t allocation_size = space->AllocationSize(object.get()); 366 EXPECT_EQ(bytes_allocated, allocation_size); 367 if (object_size > 0) { 368 EXPECT_GE(allocation_size, static_cast<size_t>(object_size)); 369 } else { 370 EXPECT_GE(allocation_size, 8u); 371 } 372 amount_allocated += allocation_size; 373 break; 374 } 375 } 376 if (alloc_fails == max_fails) { 377 last_object = i; 378 break; 379 } 380 } 381 CHECK_NE(last_object, 0u); // we should have filled the space 382 EXPECT_GT(amount_allocated, 0u); 383 384 // We shouldn't have gone past the growth_limit 385 EXPECT_LE(amount_allocated, growth_limit); 386 EXPECT_LE(footprint, growth_limit); 387 EXPECT_LE(space->Size(), growth_limit); 388 389 // footprint and size should agree with amount allocated 390 EXPECT_GE(footprint, amount_allocated); 391 EXPECT_GE(space->Size(), amount_allocated); 392 393 // Release storage in a semi-adhoc manner 394 size_t free_increment = 96; 395 while (true) { 396 { 397 ScopedThreadStateChange tsc(self, kNative); 398 // Give the space a haircut. 399 space->Trim(); 400 } 401 402 // Bounds sanity 403 footprint = space->GetFootprint(); 404 EXPECT_LE(amount_allocated, growth_limit); 405 EXPECT_GE(footprint, amount_allocated); 406 EXPECT_LE(footprint, growth_limit); 407 EXPECT_GE(space->Size(), amount_allocated); 408 EXPECT_LE(space->Size(), growth_limit); 409 410 if (free_increment == 0) { 411 break; 412 } 413 414 // Free some objects 415 for (size_t i = 0; i < last_object; i += free_increment) { 416 mirror::Object* object = lots_of_objects.get()[i]; 417 if (object == nullptr) { 418 continue; 419 } 420 size_t allocation_size = space->AllocationSize(object); 421 if (object_size > 0) { 422 EXPECT_GE(allocation_size, static_cast<size_t>(object_size)); 423 } else { 424 EXPECT_GE(allocation_size, 8u); 425 } 426 space->Free(self, object); 427 lots_of_objects.get()[i] = nullptr; 428 amount_allocated -= allocation_size; 429 footprint = space->GetFootprint(); 430 EXPECT_GE(space->Size(), footprint); // invariant 431 } 432 433 free_increment >>= 1; 434 } 435 436 // The space has become empty here before allocating a large object 437 // below. For RosAlloc, revoke thread-local runs, which are kept 438 // even when empty for a performance reason, so that they won't 439 // cause the following large object allocation to fail due to 440 // potential fragmentation. Note they are normally revoked at each 441 // GC (but no GC here.) 442 space->RevokeAllThreadLocalBuffers(); 443 444 // All memory was released, try a large allocation to check freed memory is being coalesced 445 SirtRef<mirror::Object> large_object(self, nullptr); 446 size_t three_quarters_space = (growth_limit / 2) + (growth_limit / 4); 447 size_t bytes_allocated = 0; 448 if (round <= 1) { 449 large_object.reset(space->Alloc(self, three_quarters_space, &bytes_allocated)); 450 } else { 451 large_object.reset(space->AllocWithGrowth(self, three_quarters_space, &bytes_allocated)); 452 } 453 EXPECT_TRUE(large_object.get() != nullptr); 454 InstallClass(large_object, three_quarters_space); 455 456 // Sanity check footprint 457 footprint = space->GetFootprint(); 458 EXPECT_LE(footprint, growth_limit); 459 EXPECT_GE(space->Size(), footprint); 460 EXPECT_LE(space->Size(), growth_limit); 461 462 // Clean up 463 space->Free(self, large_object.reset(nullptr)); 464 465 // Sanity check footprint 466 footprint = space->GetFootprint(); 467 EXPECT_LE(footprint, growth_limit); 468 EXPECT_GE(space->Size(), footprint); 469 EXPECT_LE(space->Size(), growth_limit); 470} 471 472void SpaceTest::SizeFootPrintGrowthLimitAndTrimDriver(size_t object_size, CreateSpaceFn create_space) { 473 if (object_size < SizeOfZeroLengthByteArray()) { 474 // Too small for the object layout/model. 475 return; 476 } 477 size_t initial_size = 4 * MB; 478 size_t growth_limit = 8 * MB; 479 size_t capacity = 16 * MB; 480 MallocSpace* space(create_space("test", initial_size, growth_limit, capacity, nullptr)); 481 ASSERT_TRUE(space != nullptr); 482 483 // Basic sanity 484 EXPECT_EQ(space->Capacity(), growth_limit); 485 EXPECT_EQ(space->NonGrowthLimitCapacity(), capacity); 486 487 // Make space findable to the heap, will also delete space when runtime is cleaned up 488 AddSpace(space); 489 490 // In this round we don't allocate with growth and therefore can't grow past the initial size. 491 // This effectively makes the growth_limit the initial_size, so assert this. 492 SizeFootPrintGrowthLimitAndTrimBody(space, object_size, 1, initial_size); 493 SizeFootPrintGrowthLimitAndTrimBody(space, object_size, 2, growth_limit); 494 // Remove growth limit 495 space->ClearGrowthLimit(); 496 EXPECT_EQ(space->Capacity(), capacity); 497 SizeFootPrintGrowthLimitAndTrimBody(space, object_size, 3, capacity); 498} 499 500#define TEST_SizeFootPrintGrowthLimitAndTrim(name, spaceName, spaceFn, size) \ 501 TEST_F(spaceName##Test, SizeFootPrintGrowthLimitAndTrim_AllocationsOf_##name) { \ 502 SizeFootPrintGrowthLimitAndTrimDriver(size, spaceFn); \ 503 } \ 504 TEST_F(spaceName##Test, SizeFootPrintGrowthLimitAndTrim_RandomAllocationsWithMax_##name) { \ 505 SizeFootPrintGrowthLimitAndTrimDriver(-size, spaceFn); \ 506 } 507 508#define TEST_SPACE_CREATE_FN(spaceName, spaceFn) \ 509 class spaceName##Test : public SpaceTest { \ 510 }; \ 511 \ 512 TEST_F(spaceName##Test, Init) { \ 513 InitTestBody(spaceFn); \ 514 } \ 515 TEST_F(spaceName##Test, ZygoteSpace) { \ 516 ZygoteSpaceTestBody(spaceFn); \ 517 } \ 518 TEST_F(spaceName##Test, AllocAndFree) { \ 519 AllocAndFreeTestBody(spaceFn); \ 520 } \ 521 TEST_F(spaceName##Test, AllocAndFreeList) { \ 522 AllocAndFreeListTestBody(spaceFn); \ 523 } \ 524 TEST_F(spaceName##Test, SizeFootPrintGrowthLimitAndTrim_AllocationsOf_12B) { \ 525 SizeFootPrintGrowthLimitAndTrimDriver(12, spaceFn); \ 526 } \ 527 TEST_SizeFootPrintGrowthLimitAndTrim(16B, spaceName, spaceFn, 16) \ 528 TEST_SizeFootPrintGrowthLimitAndTrim(24B, spaceName, spaceFn, 24) \ 529 TEST_SizeFootPrintGrowthLimitAndTrim(32B, spaceName, spaceFn, 32) \ 530 TEST_SizeFootPrintGrowthLimitAndTrim(64B, spaceName, spaceFn, 64) \ 531 TEST_SizeFootPrintGrowthLimitAndTrim(128B, spaceName, spaceFn, 128) \ 532 TEST_SizeFootPrintGrowthLimitAndTrim(1KB, spaceName, spaceFn, 1 * KB) \ 533 TEST_SizeFootPrintGrowthLimitAndTrim(4KB, spaceName, spaceFn, 4 * KB) \ 534 TEST_SizeFootPrintGrowthLimitAndTrim(1MB, spaceName, spaceFn, 1 * MB) \ 535 TEST_SizeFootPrintGrowthLimitAndTrim(4MB, spaceName, spaceFn, 4 * MB) \ 536 TEST_SizeFootPrintGrowthLimitAndTrim(8MB, spaceName, spaceFn, 8 * MB) 537 538} // namespace space 539} // namespace gc 540} // namespace art 541 542#endif // ART_RUNTIME_GC_SPACE_SPACE_TEST_H_ 543