Afaik memory gets allocated as soon as the compiler comes to a ‘new’ statement (roughly).
What your are talking about is something called ‘lazyness’. It’s a feature of other languages, which try to only compute / allocate stuff, when the stuff is needed. Some languages are completely lazy, like Haskell, every value is lazy there, others allow specifying if you want your stuff to be lazy, for example scala, which has the ‘lazy’ keyword.
Anyways. One more thing I’d like to say:
Arrays are pointers to memory locations where the array saves it’s values.
So if you create an array like in your example the ‘values’, then the local variable ‘values’ gets an integer assigned, which says where to look for the data inside the memory.
This means if you allocate ‘values’ you actually allocate 10 bytes + 4 bytes for the integer pointer (on 32 bit JVM’s, 8 byte on 64 bit JVM’s).
(this is not true for your [icode]byte value = 10;[/icode] example, but true for [icode]Byte byteWrapper = 10;[/icode], but that’s another story)
If you have a so-called two-dimensional array, then you really have arrays inside an array. This means your ‘valuesMany’ looks like this actually, where each [ ] pair is an array (and with that also a pointer).
[ [0 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0 0 0] ]
What does that mean?
Each “[” is another pointer…:
byte[][] valuesMany = new byte[][] {
new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
}
(^^^ pseudocode ^^^)
See these lots of ‘new’ keywords? 
In the end this means you have 10 * 10 bytes (of data) + 11 pointer
in case of a 64 bit JVM this would be 10 * 10 + 11 * 8 byte = 188 bytes
instead of the expected 100 bytes.
Thats it with todays lesson 