Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 213
  • Last Modified:

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
0
Xavior2K3
Asked:
Xavior2K3
  • 2
1 Solution
 
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.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now