This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Building Blockchain Apps and have Michael Yuan on-line!
See this thread for details.
Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

outofmemory increasing heap past the cap.

 
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?
 
author
Posts: 23868
141
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux 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?
 
That's a very big dog. I think I want to go home now and hug this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!