Page 1 of 2

Too much lag in new update

PostPosted: 04 Oct 2018, 22:25
by peepser
Why does the game slow to a crawl after an hour? I'm running it on a fast PC, with 8 gigs ram, and it always starts to lag, making it impossible to play. And the problem is this happens while I'm in the middle of a gauntlet against the AI. Is there any way to fix this?

Re: Too much lag in new update

PostPosted: 05 Oct 2018, 18:12
by Reman
Yeah there's a pretty significant memory leak problem after playing a bit. Closing the program an reopening fixes the issue, but it's annoying to have to do so.

Re: Too much lag in new update

PostPosted: 05 Oct 2018, 20:06
by timmermac
As has been mentioned, increase the amount of memory allocated to Java.

Re: Too much lag in new update

PostPosted: 06 Oct 2018, 22:19
by Reman
timmermac wrote:As has been mentioned, increase the amount of memory allocated to Java.
How do you do this? I've Googled it for ~30 mins and all I can find are Minecraft settings tutorials.

Also, why is this even necessary? Isn't there a development setting that can default Java to have enough RAM to prevent this?

At the very least, I think a guide to assigning more RAM should be in the FAQ...

Re: Too much lag in new update

PostPosted: 07 Oct 2018, 00:06
by peepser
Yes, if there is a way to allocate more ram to java, I'd like to know what it is, too. Killing a gauntlet in mid game to get it moving again isn't a solution.

Re: Too much lag in new update

PostPosted: 07 Oct 2018, 08:43
by Reman
peepser wrote:Yes, if there is a way to allocate more ram to java, I'd like to know what it is, too. Killing a gauntlet in mid game to get it moving again isn't a solution.
Note, I think I might have found an alternative solution. One of the posts I unearthed on this forum indicated that starting the game from forge.exe instead of the Java JAR file could do the trick. I've been playing it through the executable for 6 hours now with no issues, which I was never able to do before.

Re: Too much lag in new update

PostPosted: 07 Oct 2018, 18:11
by peepser
I always start with the exe, still have the lag after an hour. I tried this https://www.wikihow.com/Increase-Java-M ... -Windows-7 but cannot confirm yet if it works. Edit: It does work! Edit: It extends the time a bit, but it eventually slows to a crawl after three hours.

Re: Too much lag in new update

PostPosted: 07 Oct 2018, 23:03
by Fizanko
Instead of starting with the exe , as from what i read it gives Forge a max memory of 1gb (so forge can be played on any system) , if you have more than that on your system , try this (at least on windows)

in the Forge directory where the forge.exe is existing , create a new text file (right click -> new -> text document)
inside that text file paste

Code: Select all
java -Xmx2048m -jar nameoftheforgejar.jar
with nameoftheforgejar.jar being the name of the .jar file that exist along forge.exe in that directory.

By example on the current snapshot i'm using , the name is
Code: Select all
forge-gui-desktop-1.6.17-SNAPSHOT-jar-with-dependencies.jar
So the line i have in my text file is
Code: Select all
java -Xmx2048m -jar forge-gui-desktop-1.6.17-SNAPSHOT-jar-with-dependencies.jar
Now the other important part is -Xmx2048m , it means it will allow a max of 2gb of memory being used by Forge.

It's important to point that in the case you only have 2gb of memory, it will not work, the OS + whatever background program are running already eat some memory.

Now if you have a lot of memory, you can increase this value by example to -Xmx4096m if you want to allow Forge to use at max 4gb (but make sure your system have more than that.

Now in case your system only have 2gb but you would like to still allow more than the default 1gb the forge.exe allows, try -Xmx1536m

Once you have setup that line in your text file correctly, save and close, then RENAME this new text file extension from its default .txt into .bat
by example rename
Code: Select all
New Text Document.txt
into
Code: Select all
Play Forge.bat
And instead of using the forge.exe to launch Forge, use this .bat file.
Remember that the name of the .jar file may change with newer version of Forge, so rename accordingly.

Re: Too much lag in new update

PostPosted: 08 Oct 2018, 03:13
by squee1968
followed the instructions above, but when i double click the .bat file, a black box appears briefly, but forge doesn't start.

Re: Too much lag in new update

PostPosted: 08 Oct 2018, 12:04
by Fizanko
Make sure you have the .bat file in the same directory as where your forge.exe (and the .jar file is), and make sure the .jar name is correct (depending on forge version or the snapshot used the .jar file name may be different)

If all is setup correctly, give a try with
Code: Select all
-Xmx1536m
I tried on an older system that has 3gb of memory and it does not start with -Xmx2048m for some reason , but with -Xmx1536m it works.

Re: Too much lag in new update

PostPosted: 08 Oct 2018, 23:58
by Reman
I similarly followed the instructions above, but am getting the same error as Squee. The command prompt opens briefly, then immediately closes without the game launching. For the record, my computer has 16 GB of RAM so that shouldn't be an issue.

Image

Re: Too much lag in new update

PostPosted: 09 Oct 2018, 00:31
by friarsol
Reman wrote:I similarly followed the instructions above, but am getting the same error as Squee. The command prompt opens briefly, then immediately closes without the game launching. For the record, my computer has 16 GB of RAM so that shouldn't be an issue.

Image
If it's opening and closing there's probably some error that it's spitting out that you can't see. You should be able to add this line to your batch file `set /p=Hit ENTER to continue...`

Re: Too much lag in new update

PostPosted: 09 Oct 2018, 12:17
by Reman
Indeed there was. I got the error "Too small initial heap".

Any idea how to fix it?

Re: Too much lag in new update

PostPosted: 09 Oct 2018, 14:58
by peepser
I can confirm that the link I previously posted above does work. I allowed 3 gigs of ram to java. I never had any slowdowns after playing over 2 hours.

Re: Too much lag in new update

PostPosted: 09 Oct 2018, 18:44
by Fizanko
Reman wrote:Indeed there was. I got the error "Too small initial heap".

Any idea how to fix it?
I noticed in your screenshot you have
Code: Select all
-Xmx2048
instead of
Code: Select all
-Xmx2048m
You forget the ' m ' after 2048, that may be why it does not work.