Array Maximum Bounds - OutOfMemoryError

Hi,

I'm trying to create an array with the following:

      int[][] imgArray = new int[3200][4800];

But i get an error:

      Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

Why is this and is there any way around it? Are there maximum array bounds?

Thanks,
Michael
LVL 1
Xavior2K3Asked:
Who is Participating?
 
hoomanvCommented:
Increase the heap size
    -Xms<size>        set initial Java heap size
    -Xmx<size>        set maximum Java heap size
java.exe -xmx512m
0
 
hoomanvCommented:
Since 3200 * 4800 * 4 (int size) = 58.6 MB
0
 
Xavior2K3Author Commented:
Great, thanks =)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.