Solved

Array Maximum Bounds - OutOfMemoryError

Posted on 2006-10-22
3
193 Views
Last Modified: 2011-10-03
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
Comment
Question by:Xavior2K3
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
hoomanv earned 250 total points
ID: 17783152
Increase the heap size
    -Xms<size>        set initial Java heap size
    -Xmx<size>        set maximum Java heap size
java.exe -xmx512m
0
 
LVL 14

Expert Comment

by:hoomanv
ID: 17783157
Since 3200 * 4800 * 4 (int size) = 58.6 MB
0
 
LVL 1

Author Comment

by:Xavior2K3
ID: 17797788
Great, thanks =)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now