Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: Keep running out of memory when trying to enter a system from Hyperspace  (Read 5423 times)

HeliosRX

  • Ensign
  • *
  • Posts: 31
    • View Profile

I get a null error every time I try to enter a system from hyperspace.
Here's the error log:

96514 [Thread-6] DEBUG com.fs.graphics.TextureLoader  - Loading image graphics/backgrounds/hii_background.jpg into existing tex id 315
96724 [Thread-6] ERROR com.fs.starfarer.combat.String  - java.lang.OutOfMemoryError
java.lang.OutOfMemoryError
   at sun.misc.Unsafe.allocateMemory(Native Method)
   at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:99)
   at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:288)
   at org.lwjgl.BufferUtils.createByteBuffer(BufferUtils.java:60)
   at com.fs.graphics.TextureLoader.o00000(Unknown Source)
   at com.fs.graphics.TextureLoader.o00000(Unknown Source)
   at com.fs.graphics.TextureLoader.o00000(Unknown Source)
   at com.fs.starfarer.util.ReplaceableSprite.?O000(Unknown Source)
   at com.fs.starfarer.campaign.BackgroundAndStars.super.super(Unknown Source)
   at com.fs.starfarer.campaign.BaseLocation.renderBG(Unknown Source)
   at com.fs.starfarer.campaign.CampaignEngine.renderBG(Unknown Source)
   at com.fs.starfarer.campaign.A.?0000(Unknown Source)
   at com.fs.starfarer.OoOO.??000(Unknown Source)
   at com.fs.super.oOOO.?00000(Unknown Source)
   at com.fs.starfarer.combat.String.o00000(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
   at java.lang.Thread.run(Thread.java:619)

I also consistently run out of memory every hour or so.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24155
    • View Profile
Re: Keep running out of memory when trying to enter a system from Hyperspace
« Reply #1 on: October 16, 2013, 12:16:45 PM »

Hi -

Looks like you're using a mod, which is probably part of the issue. Some mods (and especially if you're using multiple mods at the same time) raise the memory requirements drastically.

If you take a look at this post:
http://fractalsoftworks.com/forum/index.php?topic=5310.msg111235#msg111235
It shows how to change the memory allocated for the game. I'd suggest trying 1024 for both values.

Also, you may want to turn on save game compression (by setting compressSaveGameData to true in data/config/settings.json). That can help with memory use when using the larger mods.

This won't help if there's an actual memory leak in one of the mods, though; it'd just delay the problem.
Logged

HeliosRX

  • Ensign
  • *
  • Posts: 31
    • View Profile
Re: Keep running out of memory when trying to enter a system from Hyperspace
« Reply #2 on: October 16, 2013, 02:13:23 PM »

My java settings are already at 1024, 1024... and the game crashes upon launch if I try any values higher than that. This is odd because my old laptop ran fine with these settings and the new one constantly crashes if I look at it funny.

Save compression is also on, by the way.

I notice that this problem only appears when I try to enter modded systems, but I can't figure out for the life of me why that happens. The vanilla sectors load and run fine.

If you need computer specs, I'm running a Dell Vostro with a 2.20 GHz i7 processor and 8 GB ram. OS is Windows 8 Professional.


Maybe I need a 64 bit version of java if one exists?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24155
    • View Profile
Re: Keep running out of memory when trying to enter a system from Hyperspace
« Reply #3 on: October 16, 2013, 02:28:52 PM »

Maybe I need a 64 bit version of java if one exists?

That'd let you run with more memory - what you want to do is install a 64-bit version of java, and then replace the contents of the "jre" folder in the Starsector folder with the contents of the jre folder (or the jreX folder, if you just installed the JRE rather than the JDK).

I notice that this problem only appears when I try to enter modded systems, but I can't figure out for the life of me why that happens. The vanilla sectors load and run fine.

I really can't say... One possibility is an extremely high-resolution background in a modded star system. Part of it is just that mods tend to push the envelope in terms of the number of star systems and fleets and eat up a lot of memory in the process.
Logged

HeliosRX

  • Ensign
  • *
  • Posts: 31
    • View Profile
Re: Keep running out of memory when trying to enter a system from Hyperspace
« Reply #4 on: October 17, 2013, 05:50:15 AM »

I've installed a 64 bit version of java and replaced the jre folder with the new version of java, but now I get a java related error whenever I start up the game.
It goes:

The procedure entry point _JVM_SetNativeThreadName@12 could not be located in the dynamic link library C:\Program Files (x86)\Fractal Softworks\Starsector\jre\bin\java.dll.

So.... what do I do?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24155
    • View Profile
Re: Keep running out of memory when trying to enter a system from Hyperspace
« Reply #5 on: October 17, 2013, 10:03:04 AM »

My guess would be you didn't quite replace the jre folder with the right stuff. Is that dll even there?
Logged

HeliosRX

  • Ensign
  • *
  • Posts: 31
    • View Profile
Re: Keep running out of memory when trying to enter a system from Hyperspace
« Reply #6 on: October 17, 2013, 03:06:32 PM »

OK, tried a different approach by uninstalling fully and reinstalling the game.

Error now occasionally pops up upon entering a system, but engaging a battle gives me the same error message if the battle size is larger than even a small skirmish.

And yeah, it's pretty much the same error.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24155
    • View Profile
Re: Keep running out of memory when trying to enter a system from Hyperspace
« Reply #7 on: October 17, 2013, 03:14:35 PM »

Hmm. Not sure what I can do here, unfortunately; I think it's probably just collapsing under the combined weight of mods. There's always the possibility that a mod has a memory leak in it, too. IF that's not the case, then using 64-bit java would be the way to go, along with upping the memory to 2048 or so.

(What you want to do is replace the contents of the jre folder under Starsector/ with the contents of C:\Program Files\Java\jre6 (or wherever you installed the 64-bit JRE to on your system. You did mention it not working for you, but others have mentioned it work for them; so it's at least possible you could get that to work.)


In the future, the game is going to support more star systems with less strain. For the moment, though, mods (some especially) are operating pretty far outside the vanilla parameters, and if you combine a couple, well...
Logged

Jazwana

  • Commander
  • ***
  • Posts: 108
    • View Profile
Re: Keep running out of memory when trying to enter a system from Hyperspace
« Reply #8 on: October 18, 2013, 12:55:31 PM »

Just want to say - replacing the packaged 32-bit java with 64-bit java (version 7 update 45) and changing to 1024 2048 (from 1024/1024) worked wonders for myself with Ironclads mod.  Haven't tried it with Uumoz's Corvus or Exerelin but it completely cleaned up the 'hangs' on loading/deloading large battles, changing systems, etc.

Logged