Java Heap is limit for size of objects those you can have in system. If your object's size is beyond heap then Out Of Memory error would be generated.
In your case your total object's size (Object's in ArrayList + other objects in your system) matters more, As your ArrayList would be just referencing these Object's.
Here are VM options you can use to set Heap Size as per your requirement (from the java
documentation):
-Xms
n
Specify the initial size, in bytes, of
the memory allocation pool. This value
must be a multiple of 1024 greater
than 1MB. Append the letter k or K to
indicate kilobytes, or m or M to
indicate megabytes. The default value
is 2MB. Examples:
-Xms6291456
-Xms6144k
-Xms6m
-Xmx
n
Specify the maximum size, in bytes, of
the memory allocation pool. This value
must a multiple of 1024 greater than
2MB. Append the letter k or K to
indicate kilobytes, or m or M to
indicate megabytes. The default value
is 64MB. Examples:
-Xmx83886080
-Xmx81920k
-Xmx80m
Check Heap info from VM Spec
3.5.3 Heap
The Java virtual machine has a heap that is shared among all Java virtual machine >threads. The heap is the runtime data area from which memory for all class instances and >arrays is allocated.
The heap is created on virtual machine start-up. Heap storage for objects is reclaimed by >an automatic storage management system (known as a garbage collector); objects are never >explicitly deallocated. The Java virtual machine assumes no particular type of automatic >storage management system, and the storage management technique may be chosen according >to the implementor's system requirements. The heap may be of a fixed size or may be >expanded as required by the computation and may be contracted if a larger heap becomes >unnecessary. The memory for the heap does not need to be contiguous.
A Java virtual machine implementation may provide the programmer or the user control over >the initial size of the heap, as well as, if the heap can be dynamically expanded or >contracted, control over the maximum and minimum heap size.5
The following exceptional condition is associated with the heap:
If a computation requires more heap than can be made available by the automatic storage management system, the Java virtual machine throws an OutOfMemoryError.