@Test
public void testAfterAllocation() throws InterruptedException, IOException {

  System.setProperty("spf4j.perf.allocations.sampleTimeMillis", "1000");
  MemoryUsageSampler.start(500);
  OpenFilesSampler.start(500, 512, 1000, false);
  for (int i = 0; i < 1000; i++) {
    LOG.debug("T{}", i);
    if (i % 100 == 0) {
      Thread.sleep(500);
    }
  }
  testAllocInStaticContext();
  TestClass.testAllocInStaticContext();
  RecorderFactory.MEASUREMENT_STORE.flush();
  MeasurementStoreQuery query = RecorderFactory.MEASUREMENT_STORE.query();
  Collection<Schema> measurements = query.getMeasurements((x) -> "heap_used".equals(x));
  Assert.assertEquals(1, measurements.size());
  MemoryUsageSampler.stop();
  OpenFilesSampler.stop();
}