Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: Game slowing to a crawl after large fights  (Read 7683 times)

Plasmatic

  • Admiral
  • *****
  • Posts: 500
  • Curious no?
    • View Profile
Game slowing to a crawl after large fights
« on: January 07, 2022, 11:52:08 AM »

When I first load up the game its rock solid at 60 FPS and 57-65% Idle.

But somehow after a very large and extended battle, the game slows to 17 FPS and 0% Idle.

If I save the game, restart and load back in, its right back up to 60 FPS and 57-65% Idle, until a little while and a large fight again.
(large fight being my 2 carriers vs 5-10 ships)

Is this a memory leak or whats going on? I can't really see anything in the logs.

Could it be a mod that is causing it?
Logged
"Better to remain silent and be thought a fool than to speak out and remove all doubt"
- Maurice Switzer

Wispborne

  • Captain
  • ****
  • Posts: 413
  • Discord: wispborne
    • View Profile
Re: Game slowing to a crawl after large fights
« Reply #1 on: January 07, 2022, 12:37:08 PM »

It's caused by using mods in general, regardless of your PC specs.
The only known fix is switching to JRE 8.

Guide here:
https://fractalsoftworks.com/forum/index.php?topic=25974.0
« Last Edit: April 26, 2023, 09:11:28 PM by Wispborne »
Logged
Mod: Persean Chronicles | Mod Managers: SMOL & TriOS | Tool: VRAM Estimator | Tool: Forum+Discord Mod Database | If I'm inactive for 3 months, anyone can use any of my work for anything (except selling it or its derivatives).

Plasmatic

  • Admiral
  • *****
  • Posts: 500
  • Curious no?
    • View Profile
Re: Game slowing to a crawl after large fights
« Reply #2 on: January 07, 2022, 01:33:03 PM »

Thank you, I will try that, I have downloaded Java 8 on my computer, but I guess Starsector uses its own Java regardless.
Logged
"Better to remain silent and be thought a fool than to speak out and remove all doubt"
- Maurice Switzer

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7227
  • Harpoon Affectionado
    • View Profile
Re: Game slowing to a crawl after large fights
« Reply #3 on: January 07, 2022, 02:29:57 PM »

Does anyone know why this happens to some people and not others? I've never had it happen and while I don't play with heavy mods, I do with like a dozen plus libraries at times. I don't use graphicslib except when I have to for a faction and in that case I switch its shaders etc off.
Logged

Ruddygreat

  • Admiral
  • *****
  • Posts: 524
  • Seals :^)
    • View Profile
Re: Game slowing to a crawl after large fights
« Reply #4 on: January 07, 2022, 04:36:27 PM »

Does anyone know why this happens to some people and not others? I've never had it happen and while I don't play with heavy mods, I do with like a dozen plus libraries at times. I don't use graphicslib except when I have to for a faction and in that case I switch its shaders etc off.

(quoting from memory of something DR said in discord)

iirc it only happens when you're running with glib shaders enabled because it loads so many extra sprites that the java 7 garbage collector kinda chokes and dies on them
you can temporarily stop the slowdown by using the "toggle shaders" hotkey in graphicslib, but it'll just come back when you turn them back on

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7227
  • Harpoon Affectionado
    • View Profile
Re: Game slowing to a crawl after large fights
« Reply #5 on: January 07, 2022, 04:57:03 PM »

Makes sense!
Logged

SafariJohn

  • Admiral
  • *****
  • Posts: 3023
    • View Profile
Re: Game slowing to a crawl after large fights
« Reply #6 on: January 07, 2022, 05:56:43 PM »

I have encountered this at least once. Dum-dum that I am, I did the reload fix before I could remember "Hey, I am a programmer! I could profile this!"
Logged

Plasmatic

  • Admiral
  • *****
  • Posts: 500
  • Curious no?
    • View Profile
Re: Game slowing to a crawl after large fights
« Reply #7 on: January 08, 2022, 10:59:53 AM »

Does anyone know why this happens to some people and not others? I've never had it happen and while I don't play with heavy mods, I do with like a dozen plus libraries at times. I don't use graphicslib except when I have to for a faction and in that case I switch its shaders etc off.

(quoting from memory of something DR said in discord)

iirc it only happens when you're running with glib shaders enabled because it loads so many extra sprites that the java 7 garbage collector kinda chokes and dies on them
you can temporarily stop the slowdown by using the "toggle shaders" hotkey in graphicslib, but it'll just come back when you turn them back on

I've updated to Java 8, and while it has absolutely improved, a long session will still gradually slow down more and more still, but instead of having to restart every 10-30 min (depending on combat) I can play fine for a couple hours before its even noticably below 60 fps.

So I'd say it's more or less fixed.
Logged
"Better to remain silent and be thought a fool than to speak out and remove all doubt"
- Maurice Switzer

Wyvern

  • Admiral
  • *****
  • Posts: 3803
    • View Profile
Re: Game slowing to a crawl after large fights
« Reply #8 on: January 08, 2022, 03:38:27 PM »

I decided to test this - was curious if going to java 8 would make scaling work properly without having to go fullscreen - and the provided instructions for installing jre8 do not work with Starsector on mac.

There is no 'jre' folder, the closest equivalent seems to be 'Home'.

I downloaded jre-8u311-macosx-x64.tar.gz from oracle; this did decompress to a folder structure with what appeared to be an equivalent 'Home' folder to it - but substituting that in for Starsector's 'Home' folder just results in "Error: A JNI error has occurred" and "java.lang.ClassFormatError: Illegal field name "null.class" in class com/fs/starfarer/StarfarerLauncher".
Logged
Wyvern is 100% correct about the math.

Micah_Lamar

  • Ensign
  • *
  • Posts: 3
    • View Profile
Re: Game slowing to a crawl after large fights
« Reply #9 on: August 10, 2022, 08:27:36 AM »

Had the same problem, removed/disabled Starship Legends, that fixed it.
Logged

Brainwright

  • Admiral
  • *****
  • Posts: 622
    • View Profile
Re: Game slowing to a crawl after large fights
« Reply #10 on: August 10, 2022, 10:16:18 PM »

I had the same problem until I did the Java 8 unofficial patch via https://fractalsoftworks.com/forum/index.php?topic=19879.msg355617#msg355617
Logged