MCPcopy Create free account
hub / github.com/async-profiler/async-profiler / CallsRealloc

Class CallsRealloc

test/test/nativemem/CallsRealloc.java:8–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6package test.nativemem;
7
8public class CallsRealloc {
9
10 private static final int MALLOC_SIZE = 1999993; // Prime size, useful in assertions.
11 private static final int REALLOC_SIZE = 30000170;
12
13 public static void main(String[] args) throws InterruptedException {
14 final boolean once = args.length > 0 && args[0].equals("once");
15
16 do {
17 long addr = Native.malloc(MALLOC_SIZE);
18 long reallocd = Native.realloc(addr, REALLOC_SIZE);
19
20 // allocate every 1 second.
21 Thread.sleep(1000);
22 } while (!once);
23 }
24}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected