Skip to content

Instantly share code, notes, and snippets.

@abelsromero
Last active April 9, 2019 15:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abelsromero/c82f6120de726f0663ef50dac8f0a94c to your computer and use it in GitHub Desktop.
Save abelsromero/c82f6120de726f0663ef50dac8f0a94c to your computer and use it in GitHub Desktop.
Simple Java native image with GraalV POC
/**
* This simple code, loops endlessly through the values of a pair of int value.
* However, when running, the memory consumption increases up to 256,3M, at that moment it stabilizes for a while.
* After a brief moment, memory increases to 257,3MB and stops there.
* Env: Windows 10 + WSL + GraalVM 1.0.0-rc-15
*/
public class MiniLauncher {
public static void main(String[] args) {
int col = 0;
int i = 0;
for (i = 0; i < Integer.MAX_VALUE; i++) {
if (i % 10000 == 0) {
System.out.print(" " + i);
col++;
if (col == 10) {
System.out.println();
col = 0;
}
}
if (i == Integer.MAX_VALUE - 1)
i = 0;
}
System.out.println("done!");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment