This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

outofmemory increasing heap past the cap.

 
Emnaki Chih
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 20991
76
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Emnaki Chih
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic