As far as I know, when we are creating an
ArrayList<String> list = new ArrayList<String>(SIZE);
Reference doesn't consume much space. but anyhow, some of space is used. When array is getting bigger, it could be a problem. We cannot also forget that we have got another things which use memory space.
If JVM is not able to allocate requested amount of memory it'll throw
That's it. Actually JVM memory allocation has only two possible outcomes:
There is no intermediate options, like some amount of memory is allocated.
It has nothing to do with ArrayList, it's a JVM issue. If you asking whether ArrayList somehow manages this situation in a special way - then answer is "No, it does not." It just tries to allocate amount of memory it needs and lets JVM think about the rest.