Created
February 5, 2020 05:35
-
-
Save zhuyifan2013/591c246bcc7fb7913fdc1999e1bb4174 to your computer and use it in GitHub Desktop.
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
/** | |
* VM options: -verbose:gc -Xms:20M -Xms20M -Xmn10M -XX:+PrintGCDetails | |
*/ | |
public class MemoryAllocate { | |
private static final int _1mb = 1024 * 1024; | |
public static void main(String[] args) { | |
byte[] alloc1, alloc2, alloc3, alloc4; | |
alloc1 = new byte[2 * _1mb]; | |
alloc2 = new byte[2 * _1mb]; | |
alloc3 = new byte[2 * _1mb]; | |
alloc4 = new byte[4 * _1mb]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment