Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: [1] 2

Author Topic: A bigger Java RAM allowance.  (Read 6091 times)

Silver Silence

  • Admiral
  • *****
  • Posts: 980
    • View Profile
A bigger Java RAM allowance.
« on: April 30, 2013, 09:16:31 AM »

Is there a way to allow Starfarer more RAM to use? My game regularly crashes if it approaches 1GB, so I'd like to give it like, half a gig more to use so that it can comfortably hit 1GB and carry on going without just going hrrk and flopping over. It might just be a problem with my craptop, because when it gets close to that 1GB limit, the screen often goes black after which, the screen comes back to life, starfarer having closed itself and a popup saying the display driver died and came back to life.
Logged

Sproginator

  • Admiral
  • *****
  • Posts: 3592
  • Forum Ancient
    • View Profile
Re: A bigger Java RAM allowance.
« Reply #1 on: April 30, 2013, 09:30:37 AM »

I have 16GB of RAM, What can I do to utilize it? And is there multithreading? multiple core support? TELL ME DAMN YOU! ;)
Logged
A person who's never made a mistake, never tried anything new
- Albert Einstein

As long as we don't quit, we haven't failed
- Jamie Fristrom (Programmer for Spiderman2 & Lead Developer for Energy Hook)

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24125
    • View Profile
Re: A bigger Java RAM allowance.
« Reply #2 on: April 30, 2013, 09:34:22 AM »

Edit the vmparams file, the part where it says:

-Xms512m -Xmx1024m

The numbers are the minimum and maximum amount, in megabytes. I suspect it's an issue with your laptop, though, and it'll still crash when it reaches one gig, regardless of how high you set the upper limit. Curious to see how that goes.

Edit: you may actually want to lower the upper limit to, say, 512. Just because it's using a gig doesn't mean it needs all of it at the same time, and if the limit is lower, it'll just free up unused memory more often. I suspect that may run better on your computer.
« Last Edit: April 30, 2013, 09:37:03 AM by Alex »
Logged

Silver Silence

  • Admiral
  • *****
  • Posts: 980
    • View Profile
Re: A bigger Java RAM allowance.
« Reply #3 on: April 30, 2013, 09:41:07 AM »

http://scr.hu/0zoz/zoyn5
Can't seem to save..... Tried closing firefox, closed steam, closed skype. Not sure what's using the file, I'm not playing starfarer..
Logged

FloW

  • Captain
  • ****
  • Posts: 282
    • View Profile
Re: A bigger Java RAM allowance.
« Reply #4 on: April 30, 2013, 09:45:13 AM »

You don't have the necessary permissions.
Try running notepad++ as admin, open the file and then save it.
Alternatively (and less secure), change the owner of the file (or the whole folder if you feel adventurous) to your own user.
Logged
"The point is, you see, that there is no point in driving yourself mad trying to stop yourself going mad. You might just as well give in and save your sanity for later.''
- Ford Prefect, creator of the giraffe; a very long time ago

Silver Silence

  • Admiral
  • *****
  • Posts: 980
    • View Profile
Re: A bigger Java RAM allowance.
« Reply #5 on: April 30, 2013, 09:50:21 AM »

That seems to have worked. Got no complaints of the file being open and the little red floppy disk turned back to blue. So I'm gonna go play a bit and see if that helped or made things a whole lot worse. Bumped max memory limits from 1024 to 1536 (+512MB). Wouldn't starfarer have an issue with only having 512-512 limits instead of the normal 512-1024? No room to breathe?

EDIT:
That threw a null error.  :D

Spoiler
Code
24321 [Thread-9] INFO  com.fs.starfarer.loading.scripts.ScriptStore  - Class [data.missions.lookingfortrouble.MissionDefinition] already loaded (perhaps from jar file, or due to a reference from another class), skipping compilation.
24533 [Thread-9] INFO  com.fs.starfarer.loading.scripts.ScriptStore  - Class [data.missions.recoveryposition.MissionDefinition] already loaded (perhaps from jar file, or due to a reference from another class), skipping compilation.
24698 [Thread-9] INFO  com.fs.starfarer.loading.scripts.ScriptStore  - Class [data.missions.welcometrespassers.MissionDefinition] already loaded (perhaps from jar file, or due to a reference from another class), skipping compilation.
24870 [Thread-9] INFO  com.fs.starfarer.loading.scripts.ScriptStore  - Class [data.missions.walkinthepark.MissionDefinition] already loaded (perhaps from jar file, or due to a reference from another class), skipping compilation.
25214 [Thread-9] INFO  com.fs.starfarer.loading.scripts.ScriptStore  - Class [data.missions.lost.MissionDefinition] already loaded (perhaps from jar file, or due to a reference from another class), skipping compilation.
25387 [Thread-9] INFO  com.fs.starfarer.loading.scripts.ScriptStore  - Class [data.missions.frigatefight.MissionDefinition] already loaded (perhaps from jar file, or due to a reference from another class), skipping compilation.
25594 [Thread-9] INFO  com.fs.starfarer.loading.scripts.ScriptStore  - Class [data.missions.holdandretreat.MissionDefinition] already loaded (perhaps from jar file, or due to a reference from another class), skipping compilation.
25799 [Thread-9] INFO  com.fs.starfarer.loading.scripts.ScriptStore  - Class [data.missions.convoy.MissionDefinition] already loaded (perhaps from jar file, or due to a reference from another class), skipping compilation.
25959 [Thread-9] INFO  com.fs.starfarer.loading.scripts.ScriptStore  - Class [data.missions.culmination.MissionDefinition] already loaded (perhaps from jar file, or due to a reference from another class), skipping compilation.
26123 [Thread-9] INFO  com.fs.starfarer.loading.scripts.ScriptStore  - Class [data.missions.randomjunk.MissionDefinition] already loaded (perhaps from jar file, or due to a reference from another class), skipping compilation.
26328 [Thread-9] INFO  com.fs.starfarer.loading.scripts.ScriptStore  - Class [data.missions.randomjunkv2.MissionDefinition] already loaded (perhaps from jar file, or due to a reference from another class), skipping compilation.
26541 [Thread-9] INFO  com.fs.starfarer.loading.scripts.ScriptStore  - Class [data.missions.randomvsjunk.MissionDefinition] already loaded (perhaps from jar file, or due to a reference from another class), skipping compilation.
26542 [Thread-11] ERROR com.fs.graphics.K  - closed
java.io.IOException: closed
at javax.imageio.stream.ImageInputStreamImpl.checkClosed(ImageInputStreamImpl.java:96)
at javax.imageio.stream.ImageInputStreamImpl.close(ImageInputStreamImpl.java:843)
at javax.imageio.stream.FileCacheImageInputStream.close(FileCacheImageInputStream.java:230)
at javax.imageio.ImageIO.read(ImageIO.java:1425)
at javax.imageio.ImageIO.read(ImageIO.java:1326)
at com.fs.graphics.K.String(Unknown Source)
at com.fs.graphics.K.Ò00000(Unknown Source)
at com.fs.graphics.K$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
Code
23305 [Thread-6] DEBUG com.fs.graphics.TextureLoader  - Loading [graphics/planets/clouds_banded01.png] as texture with id [graphics/planets/clouds_banded01.png]
23306 [Thread-6] DEBUG com.fs.graphics.TextureLoader  - Loading [graphics/warroom/icon_planet.png] as texture with id [graphics/warroom/icon_planet.png]
23306 [Thread-6] DEBUG com.fs.graphics.TextureLoader  - Loading [graphics/planets/gasgiant01.jpg] as texture with id [graphics/planets/gasgiant01.jpg]
23352 [Thread-9] INFO  com.fs.starfarer.loading.scripts.ScriptStore  - Class [data.missions.stricken.MissionDefinition] already loaded (perhaps from jar file, or due to a reference from another class), skipping compilation.
23497 [Thread-6] DEBUG com.fs.graphics.TextureLoader  - Loaded 75.93 MB of texture data so far
23498 [Thread-6] DEBUG com.fs.graphics.TextureLoader  - Loading [graphics/planets/clouds_banded01.png] as texture with id [graphics/planets/clouds_banded01.png]
23499 [Thread-6] DEBUG com.fs.graphics.TextureLoader  - Loading [graphics/warroom/icon_planet.png] as texture with id [graphics/warroom/icon_planet.png]
23500 [Thread-6] DEBUG com.fs.graphics.TextureLoader  - Loading [graphics/planets/star_texture_yellow.jpg] as texture with id [graphics/planets/star_texture_yellow.jpg]
23645 [Thread-6] DEBUG com.fs.graphics.TextureLoader  - Loaded 77.93 MB of texture data so far
23647 [Thread-6] DEBUG com.fs.graphics.TextureLoader  - Loading [graphics/warroom/icon_star.png] as texture with id [graphics/warroom/icon_star.png]
23654 [Thread-6] DEBUG com.fs.graphics.TextureLoader  - Loaded 78.01 MB of texture data so far
23657 [Thread-6] INFO  sound.Sound  - Loading sound [sounds/neutyfx/neut_cruise_loop.ogg]
24093 [Thread-6] ERROR com.fs.starfarer.combat.D  - 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 sound.OOoO.<clinit>(Unknown Source)
at sound.if.super(Unknown Source)
at sound.OoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.super(Unknown Source)
at sound.Sound.<init>(Unknown Source)
at com.fs.starfarer.loading.H.super(Unknown Source)
at com.fs.A.A.new(Unknown Source)
at com.fs.starfarer.combat.D.o00000(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
[close]
« Last Edit: April 30, 2013, 09:54:45 AM by Silver Silence »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24125
    • View Profile
Re: A bigger Java RAM allowance.
« Reply #6 on: April 30, 2013, 09:53:59 AM »

It should be fine. The lower limit is just what it grabs right away, doesn't mean that it needs all of it right away. It could even run for a while with 256, though you might have trouble with larger mods and longer play sessions.
Logged

Silver Silence

  • Admiral
  • *****
  • Posts: 980
    • View Profile
Re: A bigger Java RAM allowance.
« Reply #7 on: April 30, 2013, 10:32:46 AM »

Well, setting it to 512-512 seems to be doing okay. Of course, it's totally ignoring that and running at about 950MB anyway. But as this is usually the part where a battle would take several minutes to load, it's doing okay. I wonder if I can do the same to minecraft. I'll give it no working allowance whatsoever. That'll work, right? Right?  :D

No?
Okay.jpg
Logged

sarducardun

  • Commander
  • ***
  • Posts: 120
  • Welcome the angel of death
    • View Profile
Re: A bigger Java RAM allowance.
« Reply #8 on: April 30, 2013, 12:47:40 PM »

When I play heavily modded games it crashes a lot with out of java memory errors, can I do the opposite and give it 2GB to play with? Would that do anything at all?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24125
    • View Profile
Re: A bigger Java RAM allowance.
« Reply #9 on: April 30, 2013, 12:50:20 PM »

If you have the RAM, yes, that should help. Unless the mod(s) happen to have significant memory leaks, in which the extra memory will just postpone the errors.
Logged

sarducardun

  • Commander
  • ***
  • Posts: 120
  • Welcome the angel of death
    • View Profile
Re: A bigger Java RAM allowance.
« Reply #10 on: April 30, 2013, 01:06:48 PM »

Delaying the inevitable is better than nothing, vanilla has a slow leak (i think) and some of the mods probably do as well but with minimash or uomoz and a few others active I get a crash nearly every battle start, nearly every time.
Logged

Sproginator

  • Admiral
  • *****
  • Posts: 3592
  • Forum Ancient
    • View Profile
Re: A bigger Java RAM allowance.
« Reply #11 on: April 30, 2013, 01:08:43 PM »

So, in order to increase the memory to use up about 8GB I just..........
Logged
A person who's never made a mistake, never tried anything new
- Albert Einstein

As long as we don't quit, we haven't failed
- Jamie Fristrom (Programmer for Spiderman2 & Lead Developer for Energy Hook)

FloW

  • Captain
  • ****
  • Posts: 282
    • View Profile
Re: A bigger Java RAM allowance.
« Reply #12 on: April 30, 2013, 03:05:59 PM »

So, in order to increase the memory to use up about 8GB I just..........
RTFM!
-Xmx8192m I'd say, not sure if java understands 8G. Also, I think it's only possible to allocate that memory if you use a 64-bit executable of java.
Logged
"The point is, you see, that there is no point in driving yourself mad trying to stop yourself going mad. You might just as well give in and save your sanity for later.''
- Ford Prefect, creator of the giraffe; a very long time ago

Sproginator

  • Admiral
  • *****
  • Posts: 3592
  • Forum Ancient
    • View Profile
Re: A bigger Java RAM allowance.
« Reply #13 on: April 30, 2013, 03:13:29 PM »

I believe I use both lol
Logged
A person who's never made a mistake, never tried anything new
- Albert Einstein

As long as we don't quit, we haven't failed
- Jamie Fristrom (Programmer for Spiderman2 & Lead Developer for Energy Hook)

TJJ

  • Admiral
  • *****
  • Posts: 1905
    • View Profile
Re: A bigger Java RAM allowance.
« Reply #14 on: April 30, 2013, 04:28:33 PM »

RTFM!
-Xmx8192m I'd say, not sure if java understands 8G.

I was curious to know the answer to this for myself, so I looked it up.
According to this, it does.

Though I wouldn't trust what it says with regard to its use of [giga/mega/kilo]bytes, as I suspect it might well mean [gibi/mebi/kibi]bytes.
Logged
Pages: [1] 2