Changeset 231938 in webkit
- Timestamp:
- May 17, 2018 6:41:58 PM (6 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/tests/testapi.mm
r231589 r231938 1473 1473 } 1474 1474 1475 @autoreleasepool {1476 JSContext *context = [[JSContext alloc] init];1477 JSVirtualMachine *vm = [context virtualMachine];1478 [vm shrinkFootprint]; // Make sure that when we allocate a ton of memory below we reuse at little as possible.1479 1480 std::optional<size_t> footprintBefore = WTF::memoryFootprint();1481 RELEASE_ASSERT(footprintBefore);1482 1483 [context evaluateScript:@"for (let i = 0; i < 10000; ++i) { eval(`myVariable_${i} = [i]`); }"];1484 1485 static constexpr size_t approximateBytes = 10000 * sizeof(int);1486 std::optional<size_t> footprintMiddle = WTF::memoryFootprint();1487 RELEASE_ASSERT(footprintMiddle);1488 checkResult(@"Footprint is larger than what we allocated", *footprintMiddle > approximateBytes);1489 checkResult(@"Footprint got larger as we allocated a ton of stuff", *footprintMiddle > *footprintBefore);1490 size_t allocationDelta = *footprintMiddle - *footprintBefore;1491 checkResult(@"We allocated as much or more memory than what we expected to", allocationDelta >= approximateBytes);1492 1493 [context evaluateScript:@"for (let i = 0; i < 10000; ++i) { eval(`myVariable_${i} = null`); }"];1494 [vm shrinkFootprint];1495 std::optional<size_t> footprintAfter = WTF::memoryFootprint();1496 RELEASE_ASSERT(footprintAfter);1497 checkResult(@"Footprint got smaller after we shrank the VM", *footprintAfter < *footprintMiddle);1498 size_t freeDelta = *footprintMiddle - *footprintAfter;1499 checkResult(@"Shrinking the footprint of the VM actually freed memory", freeDelta > (approximateBytes / 2));1500 }1501 1502 1475 currentThisInsideBlockGetterTest(); 1503 1476 runDateTests(); -
trunk/Source/JavaScriptCore/ChangeLog
r231930 r231938 1 2018-05-17 Saam Barati <sbarati@apple.com> 2 3 Remove shrinkFootprint test from apitests since it's flaky 4 https://bugs.webkit.org/show_bug.cgi?id=185754 5 6 Reviewed by Mark Lam. 7 8 This test is flaky as it keeps failing on certain people's machines. 9 Having a test about OS footprint seems like it'll forever be doomed 10 to being flaky. 11 12 * API/tests/testapi.mm: 13 (testObjectiveCAPIMain): 14 1 15 2018-05-17 Saam Barati <sbarati@apple.com> 2 16
Note: See TracChangeset
for help on using the changeset viewer.