Jump to content

New version gives "Java Heap Space"-Error


ModernPatriot

Recommended Posts

So I just wanted to update from an older to the newest recommended version, but it fails at "DecompileMC" with the error >Java Heap Space.

I checked my .bat and gradle files and they are correct.

I already tried to alter the memory args but daemon always gave errors back.

I even created a new workspace - same error.

So how would i be able to resolve that error and how could I give JVM more ram to work with?

Link to comment
Share on other sites

So I just wanted to update from an older to the newest recommended version, but it fails at "DecompileMC" with the error >Java Heap Space.

I checked my .bat and gradle files and they are correct.

I already tried to alter the memory args but daemon always gave errors back.

I even created a new workspace - same error.

So how would i be able to resolve that error and how could I give JVM more ram to work with?

I have had the same error, too.

I fixed it like this:

1. Go to Drive:/Users/YourName/.gradle

2. Create a new file called "gradle.properties"

3. Write that in this file: org.gradle.jvmargs=-Xmx2G

4. Gradle will now fork a new JVM using Daemon. That's normal, but Gradle will now run with 2GB RAM.

 

Hope this helps you! ^^

Bringing the best mod back alive! Our mod REFORGED!

Balkon's Weapons for 1.8: https://github.com/TheOnlySilverClaw/Reforged/releases

Link to comment
Share on other sites

I can't allocate more than 1.5 gigs because of windows memory splitting. It really sucks that you can't even disable it.

It still gives the same error once I allocate more.

Because the gradle.properties way didnt work I searched for a while and came up with a way how I could change the memory allocation through the system variable _JAVA_OPTIONS.

It changes the memory now without any error but the whole process is now stuck at decompileMc and doesnt do anything once it reaches this step.

width=800 height=414http://s24.postimg.org/bu92eqiqt/Screenshot_1.png[/img]

Link to comment
Share on other sites

My experience with gradle.properties was that switches were not even read until after gradle started. It would then try to spawn a separate deamon on top of itself, causing an immediate crash.

 

What worked for me was to edit gradlew.bat, where I could inject a memory ceiling before gradle ran. Find the "set DEFAULT_JVM_OPTS=" line and give it a max heap system value such as "-Xmx1440m". In other words, instead of promising more memory that you don't have, limit the amount of memory that the JVM will attempt to take.

 

And D7 is correct that execution may be slow, but slow success is better than quick failure.

 

BTW, there's a whole child board for gradle, and it has many threads on this exact issue, including my advice posted last week.

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

Link to comment
Share on other sites

Thank you so much Jeffrey!

Its slow but it finally works. :)

 

@diesieben07 Windows memory splitting is a windows 10 software "feature" which activates once you have more or exactly 16 gigs of memory. Windows basically "splits" the ram into 16 pieces and allocates the pieces accordingly. The problem is that programs which need to access more than one gig directly (like the JVM) cant run like this. Atleast not when they think that they can take more than one gig.

You cant really disable it. The best bet, according to some Users on stackoverflow is to run your program as fast as possible once windows starts up, because it takes some time till it starts the splitting.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.