When you create an array of int's (not Integers), does java allocate an array of references for ints or the space for the ints themselves? I will be using 64-bit memory addresses for the example.
For example, if I create an int[] numbers = new int[4];
Did java do:
[64-bit array address]
[64-bit address][64-bit address][64-bit address][64-bit address]
The 64-bit address being a pointer to the memory address of the int.
or:
[64-bit array address]
[32-bit int][32-bit int][32-bit int][32-bit int]
using the method of adding 32 bits to the first memory address to address
the remaining elements in the array?
Keep in mind that I am asking about an array of a primitive data type, I fully understand that allocation of memory for an array of objects happens like the first example.
I recently moved a program I was developing from a 32-bit system to a 64-bit system and drastically less objects than the theoretical maximum for the system could be created. If Java does indeed use the first method for allocation of primitive data types, when allocating an array of ints, that array will be one 33% larger moving from a 32-bit system to a 64-bit system, and 66% larger than is really necessary.

