• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Heap Memory Issue

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm working on big Java swing application developed in JDK 1.6 and it requires 1400 MB (-Xmx1400MB) as max heap size and its working fine on windows 7 - 32 bit OS.

We have tested the same on windows 10 - 64 bit OS with -Xmx1400M option on 32-bit JRE 1.6 (client) and its failing to launch java application. It throws an error

Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine

I have tried the below options but its not working on windows 10 64 bit OS.

a. Written small code to clear heap by calling GC.
b. Analysed Heap Dump using Jhat tool
c. disable caching mechanism on windows 10 services (Prefetch & superfetch)

I tried to reboot the machine but issue still exists.
I know that JVM is not able to allocate contiguous memory space upto 1400MB. I don't know how to resolve this issue. Help Me

NOTE :

i) Our application requires 1400 MB to load big experiments. So we can not reduce the heap size.
ii) We are loading 32-bit native dlls from our Java application.so we can't move to x64 JRE.

Kindly help me to solve this issue.


Thanks,
Raj Kumar
 
author & internet detective
Posts: 41071
848
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Raj,
Calling garbage collection won't help you; that is merely a suggestion to the JVM.

You mentioned it is a Java 1.6 client. Can you try it with a Java 8 client? Most versions of the JDK make better use of memory space as time goes on.
 
Raj Gopal Kumar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have tried with latest JRE 8 client but its not helping out.
 
Jeanne Boyarsky
author & internet detective
Posts: 41071
848
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Then I think your only choice is to lower how much memory is in use at one time.

For example, load some of the data for the big experiment, start the calculation and write the result to disk. Then repeat until done. This will make the program take a lot longer to run, but at least it will load.
 
Raj Gopal Kumar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your suggestion - Jeanne Boyarsky.
 
Bartender
Posts: 1318
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mmm, try to specify a "power of two" memory size (2^n) . For example, try with -Xmx1536MB. A colleague of mine working in operations told me that sometimes he got a very similar issue to yours when he didn't specify a power of two memory size... even when the program he was trying to configure doesn't have a big memory requirement.

 
Raj Gopal Kumar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I will try this option tomorrow. Thanks for your reply - Claude Moore.
 
Claude Moore
Bartender
Posts: 1318
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried without success to replicate your problem, using  a trivial Java program. For sure, increasing available memory size will help you; what sounds strange is that error you reported is not the classical "Heap allocation error", looks really like an issue with your current Java installation.
Indeed you stated that with Windows 7, JRE 32 bit, your program worked well.
 
To get a wish, you need a genie. To get a genie, you need a lamp. To get a lamp, you need a tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic