Created
February 10, 2020 13:34
-
-
Save SergejIsbrecht/8012ad0acf0764b63e15ad6f94189ff4 to your computer and use it in GitHub Desktop.
java_malloc
This file contains hidden or 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
// https://www.javaspecialists.eu/archive/Issue142.html | |
int[] primitiveIntArray = new int[1000]; | |
primitiveIntArray[0] = 256; | |
primitiveIntArray[1] = 256; | |
primitiveIntArray[2] = 256; | |
primitiveIntArray[3] = 256; | |
primitiveIntArray[4] = 256; | |
measureSize(primitiveIntArray); | |
Integer[] iArray = new Integer[1000]; | |
iArray[0] = 256; | |
iArray[1] = 256; | |
iArray[2] = 256; | |
iArray[3] = 256; | |
iArray[4] = 256; | |
measureSize(iArray); | |
// output: | |
// int[], shallow=4016, deep=4016 | |
// Integer[], shallow=4016, deep=4016 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment