This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Java in General and the fly likes outofmemory increasing heap past the cap. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "outofmemory increasing heap past the cap." Watch "outofmemory increasing heap past the cap." New topic
Author

outofmemory increasing heap past the cap.

Emnaki Chih
Ranch Hand

Joined: Sep 01, 2004
Posts: 30
I have a program which needs to extract data from a database and then organize the data into a tree-like structure. The problem I am having is that the data is huge and takes more than the 1.5 gb heap limit, so I am getting the outofmemory exception. It seems that there is no way to get java to use more than 1.5gb. Could anyone give me any recommendations as to how to solve this problem?
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 16695
    
  19

It seems that there is no way to get java to use more than 1.5gb. Could anyone give me any recommendations as to how to solve this problem?


I am assuming that you know about Java's -Xmx switch?

The JVM is merely a process running in the underlying OS. It must live within the restrictions set by the OS. For a 32 bit OS, the process size is generally 4GB, this is further limited to what is available to the process, and further needed by the JVM process. (and 1.5 GB is about average)

Anyway, to get more heap, you will need to get a 64bit JVM, that runs on a 64bit OS, running on a 64bit processor machine.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Emnaki Chih
Ranch Hand

Joined: Sep 01, 2004
Posts: 30
Thanks for the quick reply, Yes I do know about Xmx. So is the only solution for me to get a new computer(64-bit)?? Also would reimplementing my problem with a different language be able to solve this problem?
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: outofmemory increasing heap past the cap.
 
Similar Threads
outOfMemory
Memory Leaks and OutOfMemory
OutOfMemory Error
OutOfMemory
OutOfMemory