Created
February 5, 2020 05:48
-
-
Save zhuyifan2013/8cdcf70732b43761bfbd740cce5340e9 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 -XX:PretenureSizeThreshold=3145728 | |
*/ | |
public class MemoryAllocateOld { | |
private static final int _1mb = 1024 * 1024; | |
public static void main(String[] args) { | |
byte[] alloc1, alloc2, alloc3, alloc4; | |
alloc1 = new byte[_1mb / 4]; | |
alloc2 = new byte[_1mb * 4]; | |
alloc3 = new byte[_1mb * 4]; | |
alloc4 = new byte[_1mb * 4]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment