Fractal Softworks Forum

Starsector => Mods => Modding => Topic started by: TartarusMkII on November 02, 2014, 07:30:23 PM

Title: 0.6.5a Extending Java's memory (Solution)
Post by: TartarusMkII on November 02, 2014, 07:30:23 PM
The method in this thread is old now, and Dark.Revenant's thread at http://fractalsoftworks.com/forum/index.php?topic=8726 is far superior. Please use that instead!


Hello,

During 0.6.2, I used a .batch file to run Star Sector using parameters found online to increase the amount of memory the game could use, preventing crashes where the heap would overflow.

But the .bat file no longer works with 0.6.5a, I suppose because certain file names were changed.

After testing Darloth's solution, I'll leave it here for others to use. I'd like to add that 1024m should easily be enough to allow the game to run properly, unless a mod you are using as an unfortunate leak of some kind.


Assuming a windows system, there's a file called "vmparams" in the starsector directory.

Editing that with any text editor (notepad will do but notepad++ will be better, wordpad would probably be fine too) and replacing this: "-Xms512m -Xmx512m" with this: "-Xms1024m -Xmx1024m", then save and use the launcher as usual.

You could go up to -Xms2048m -Xmx2048m if you have the ram, but in my experience this means the launcher won't start properly because Java fails to allocate all that memory.  To fix that, you may need to replace the JRE with a 64 bit version.  This basically involves downloading a recent 64bit JRE, and copying it over the one in the starsector/jre folder.  If that's too complex, try numbers in between 1024 and 2048 until something works for you.

Finally: Loading a save seems to take quite a bit more memory than actually playing the game, presumably because the game doesn't keep -everything- in memory all at the same time, but loading needs to do initial setup on everything at least once.


Title: Re: 0.6.5a Extending Java's memory (Solution)
Post by: Midnight Kitsune on November 03, 2014, 04:03:55 AM
Hello,

During 0.6.2, I used a .batch file to run Star Sector using parameters found online to increase the amount of memory the game could use, preventing crashes where the heap would overflow.

But the .bat file no longer works with 0.6.5a, I suppose because certain file names were changed.

After testing Darloth's solution, I'll leave it here for others to use. I'd like to add that 1024m should easily be enough to allow the game to run properly, unless a mod you are using as an unfortunate leak of some kind.

Assuming a windows system, there's a file called "vmparams" in the starsector directory.

Editing that with any text editor (notepad will do but notepad++ will be better, wordpad would probably be fine too) and replacing this: "-Xms512m -Xmx512m" with this: "-Xms1024m -Xmx1024m", then save and use the launcher as usual.

You could go up to -Xms2048m -Xmx2048m if you have the ram, but in my experience this means the launcher won't start properly because Java fails to allocate all that memory.  To fix that, you may need to replace the JRE with a 64 bit version.  This basically involves downloading a recent 64bit JRE, and copying it over the one in the starsector/jre folder.  If that's too complex, try numbers in between 1024 and 2048 until something works for you.

Finally: Loading a save seems to take quite a bit more memory than actually playing the game, presumably because the game doesn't keep -everything- in memory all at the same time, but loading needs to do initial setup on everything at least once
My batch file works fine over here. Did you install on top of your old 62 folder or did you uninstall and reinstall?
Title: Re: 0.6.5a Extending Java's memory (Solution)
Post by: TartarusMkII on November 03, 2014, 04:26:39 AM
I probably re-installed the new 6.5 without properly uninstalling the 6.2.
Title: Re: 0.6.5a Extending Java's memory (Solution)
Post by: gofastskatkat on December 09, 2014, 03:19:35 PM
Hey, I've been having this prob, tried to up the amount of mem it can have but my windows OS wont let me change the folder (and files in the folder) to non-read-only. Im using win 8.1 so if anyone knows how to work 8.1 please help. Thanks
Title: Re: 0.6.5a Extending Java's memory (Solution)
Post by: TartarusMkII on December 09, 2014, 03:42:21 PM
The method in this thread is old now, and Dark.Revenant's thread at http://fractalsoftworks.com/forum/index.php?topic=8726 is far superior. Please use that instead!
Title: Re: 0.6.5a Extending Java's memory (Solution)
Post by: gofastskatkat on December 09, 2014, 07:32:15 PM
thanks