Last active
April 9, 2019 15:21
-
-
Save abelsromero/c82f6120de726f0663ef50dac8f0a94c to your computer and use it in GitHub Desktop.
Simple Java native image with GraalV POC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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