Added test that ensures memory measurements are accurate by changing the gc settings