Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: PermGen space crashes  (Read 9250 times)

Dazs

  • Admiral
  • *****
  • Posts: 1070
    • View Profile
PermGen space crashes
« on: December 23, 2021, 05:13:28 AM »

I have been having random crashes after the last update of the game. I run a heavy modded game so I can ensure my three mods are compatible. I currently have my vmprams set to use 8g and haven't had issues in the past and from what I gather, PermGen is a separate memory usage. Here is a log of the last 3 crashes and the only commonality I can see is that just before the crash, the game was loading a music or sound file. Correlation or causation, idk.

 For some reason the forum will not allow me to post the logs so I have attached them

I have already removed several mods that may have been an issue but here are the current mods active during the log crash:
Spoiler
{"enabledMods": [
  "$$$_lightshow",
  "pantera_ANewLevel25",
  "anotherportraitpack",
  "apex_design",
  "armaa",
  "lw_autosave",
  "battletechportraitpack",
  "timid_admins",
  "beyondthesector",
  "BSC",
  "bountiesexpanded",
  "HMI_brighton",
  "CaptainsLog",
  "capturecrew",
  "Csp",
  "chatter",
  "timid_commissioned_hull_mods",
  "lw_console",
  "istl_dassaultmikoyan",
  "diableavionics",
  "Diktat Enhancement",
  "XLU",
  "FPE",
  "fluffships",
  "sun_fuel_siphoning",
  "GrandColonies",
  "HMI_SV",
  "HMI",
  "gunnyhegexpeditionary",
  "hte",
  "HIVER",
  "IndEvo",
  "interestingportraitspack",
  "internalaffairs",
  "Imperium",
  "JYD",
  "keruvim_shipyards",
  "LTA",
  "lw_lazylib",
  "ArkLeg",
  "locknloaded",
  "luddenhance",
  "mag_protect",
  "MagicLib",
  "Mayasuran Navy",
  "missingships",
  "more_hullmods",
  "wisp_NeutrinoDetectorMkII",
  "sun_new_beginnings",
  "nexerelin",
  "objects_analysis",
  "OcuA",
  "Ocutek",
  "JYDR",
  "ORA",
  "wisp_perseanchronicles",
  "roider",
  "sun_ruthless_sector",
  "SCY",
  "secretsofthefrontieralt",
  "SEEKER",
  "shadow_ships",
  "speedUp",
  "sun_starship_legends",
  "stelnet",
  "StopGapMeasures3",
  "superweapons",
  "timid_supply_forging",
  "surveycorpssp",
  "tahlan",
  "Terraforming & Station Construction",
  "star_federation",
  "TORCHSHIPS",
  "transfer_all_items",
  "underworld",
  "US",
  "URW",
  "vayrasector",
  "vayrashippack",
  "whichmod",
  "XhanEmpire",
  "yunruhullmods",
  "yunru_midline_expansion",
  "yunru_misc_ships",
  "yunru_pirate_collection",
  "yunrucore",
  "prv",
  "shaderLib"
]}
[close]

I have torn through this already and am stumped, any help would be appreciated.

[attachment deleted by admin]

Dazs

  • Admiral
  • *****
  • Posts: 1070
    • View Profile
Re: PermGen space crashes
« Reply #1 on: December 23, 2021, 09:56:07 AM »

here's another sound related crash log

3882856 [Thread-3] INFO  sound.public  - Cleaning up music with id [campaign_music_part_2_v28.ogg]
3882875 [Thread-7] INFO  sound.public  - Cleaning up music with id [miscallenous_corvus_campaign_music.ogg]
3883320 [Thread-3] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.OutOfMemoryError: PermGen space
java.lang.OutOfMemoryError: PermGen space
3883360 [Thread-9] INFO  sound.public  - Creating streaming player for music with id [miscallenous_corvus_campaign_music.ogg]
3883361 [Thread-9] INFO  sound.OooO  - Playing music with id [miscallenous_corvus_campaign_music.ogg]

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24125
    • View Profile
Re: PermGen space crashes
« Reply #2 on: December 23, 2021, 10:09:26 AM »

It's definitely correlation - music stuff is on another thread so it's just sprinkled in the log wherever.

You could try adding this to your vmparams:
-XX:PermSize=512m -XX:MaxPermSize=512m

That may resolve the issue, unless it's somehow caused by a leak, in which case it might only delay it instead, or even simply cause it to manifest differently.
Logged

Dazs

  • Admiral
  • *****
  • Posts: 1070
    • View Profile
Re: PermGen space crashes
« Reply #3 on: December 23, 2021, 06:49:25 PM »

That seemed to have fixed it, Ty Alex!

Zelrod92

  • Ensign
  • *
  • Posts: 21
    • View Profile
Re: PermGen space crashes
« Reply #4 on: February 27, 2022, 08:13:01 AM »

Hello, I have the same problem but I don't know where and how to  add -XX:PermSize=512m -XX:MaxPermSize=512m in the vmparams.
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4688
    • View Profile
    • GitHub profile
Re: PermGen space crashes
« Reply #5 on: February 27, 2022, 05:00:42 PM »

Something like this (change from default vmparams is bolded):

java.exe -XX:CompilerThreadPriority=1 -XX:+CompilerThreadHintNoPreempt -Djava.library.path=native\\windows -Xms1536m -Xmx1536m -Xss2048k -XX:PermSize=512m -XX:MaxPermSize=512m
Logged

Zelrod92

  • Ensign
  • *
  • Posts: 21
    • View Profile
Re: PermGen space crashes
« Reply #6 on: February 28, 2022, 06:32:03 AM »

Thanks you for helping me.
Logged

StopKickingMe

  • Ensign
  • *
  • Posts: 1
    • View Profile
Re: PermGen space crashes
« Reply #7 on: April 16, 2023, 01:59:41 AM »

Sorry to Necro, but this is in my top search results when I look up this issue. I did find the solution though, partially thanks to the previous replies.

These are the optimal vmparams contents as far as I can tell:

-XX:CompilerThreadPriority=1 -XX:+CompilerThreadHintNoPreempt -Djava.library.path=native\\windows -Xms4096m -Xmx8192m -Xss2048k -XX:+UseG1GC -XX:+UseCompressedOops -XX:ParallelGCThreads=4 -XX:MaxGCPauseMillis=200 -classpath janino.jar;commons-compiler.jar;commons-compiler-jdk.jar;starfarer.api.jar;starfarer_obf.jar;jogg-0.0.7.jar;jorbis-0.0.15.jar;json.jar;lwjgl.jar;jinput.jar;log4j-1.2.9.jar;lwjgl_util.jar;fs.sound_obf.jar;fs.common_obf.jar;xstream-1.4.10.jar -Dcom.fs.starfarer.settings.paths.saves=..\\saves -Dcom.fs.starfarer.settings.paths.screenshots=..\\screenshots -Dcom.fs.starfarer.settings.paths.mods=..\\mods -Dcom.fs.starfarer.settings.paths.logs=. com.fs.starfarer.StarfarerLauncher

It needs to be pasted all on one line or it will not work.

I am currently running a game with Nexerelin and around 120 mods, and I am not experiencing crashes or lag with the current settings. In the late game as some factions start to expand I assume that the game may sometimes slow down, but overall my experience has been shockingly stable.
Logged

Thecrippler

  • Ensign
  • *
  • Posts: 19
    • View Profile
Re: PermGen space crashes
« Reply #8 on: April 30, 2023, 11:22:23 AM »

How did you manage to get game running smooth i updated everything to the latest and my game still some time crashes and massive FPS drop after battle i was looking for solutions on the forum but can t find anything related to crashes and FPS drop also the info you posted all i need to do is copy and paste it or there is other way i have no knowledge haw to do tings also video will be nice :)
Logged

mrpras

  • Lieutenant
  • **
  • Posts: 54
    • View Profile
Re: PermGen space crashes
« Reply #9 on: May 22, 2023, 08:26:04 AM »

How did you manage to get game running smooth i updated everything to the latest and my game still some time crashes and massive FPS drop after battle i was looking for solutions on the forum but can t find anything related to crashes and FPS drop also the info you posted all i need to do is copy and paste it or there is other way i have no knowledge haw to do tings also video will be nice :)

This is my Java 8 command line (I´ve been using it for a year now and did quite some research at the time to try and improve performance). You could try it and see if it helps (make a backup of the original vmparams file first perhaps). There is a guide somewhere to help you replace JRE with a newer version (install JRE8v271 and replace the JRE folder in your starsector with the one from Java8). You can just try the command line as any commands that are J8 only will just be ignored.

java.exe -XX:+UseConcMarkSweepGC -XX:+UseFastAccessorMethods -XX:+AggressiveOpts -XX:+UseMPSS -XX:CompilerThreadPriority=1 -XX:+CompilerThreadHintNoPreempt

You can make these changes by opening the vmparams file in your starsector game folder using any text editor. In windows for example, right click the file - Open With, then choose notepad. Once you have made the changes you want, save and close the file then run starsector.

What I have shared here is only the first portion of the command (the parts that are relevant), you can just add the options after the java.exe and paste them into your command line after the java.exe and before the rest of the command. For exampe my entire vmparams looks like this:

java.exe -XX:+UseConcMarkSweepGC -XX:+UseFastAccessorMethods -XX:+AggressiveOpts -XX:+UseMPSS -XX:CompilerThreadPriority=1 -XX:+CompilerThreadHintNoPreempt -Djava.library.path=native\\windows -Xms8192m -Xmx8192m -Xss2048k -XX:PermSize=1024m -XX:MaxPermSize=1024m -classpath janino.jar;commons-compiler.jar;commons-compiler-jdk.jar;starfarer.api.jar;starfarer_obf.jar;jogg-0.0.7.jar;jorbis-0.0.15.jar;json.jar;lwjgl.jar;jinput.jar;log4j-1.2.9.jar;lwjgl_util.jar;fs.sound_obf.jar;fs.common_obf.jar;xstream-1.4.10.jar -Dcom.fs.starfarer.settings.paths.saves=..\\saves -Dcom.fs.starfarer.settings.paths.screenshots=..\\screenshots -Dcom.fs.starfarer.settings.paths.mods=..\\mods -Dcom.fs.starfarer.settings.paths.logs=. com.fs.starfarer.StarfarerLauncher
« Last Edit: May 22, 2023, 08:30:26 AM by mrpras »
Logged