Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bschoening committed Nov 16, 2021
1 parent 458e083 commit 880f15f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions GCAllocationTest.jsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//usr/bin/env jshell --show-version --execution local '-J-Xlog:gc+ergo*=trace:/tmp/gc.log' "$0" "$@"; exit $?

/*
usage: jshell '-J-Xlog:gc*=trace:/tmp/gclog.log' --execution local GCAllocationTest.jsh
*/

import java.util.stream.IntStream;
import java.util.Random;

int MB = 1024 * 1024;

IntStream.range(0, 30000).forEachOrdered(n -> {
if (n % 1000 == 0) { System.out.println(n); };
java.util.Random random = new java.util.Random();
int size = MB * (1 + random.nextInt(20));
byte[] a1 = new byte[size];
a1[1] = 1;
});

/exit

0 comments on commit 880f15f

Please sign in to comment.