Fractal Softworks Forum

Please login or register.

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

Author Topic: Running out of memory  (Read 8864 times)

CopperCoyote

  • Captain
  • ****
  • Posts: 451
    • View Profile
Running out of memory
« on: September 19, 2018, 12:08:33 PM »

Is there a way to see what is using memory?

Specifically when i spend a long time in the refit screen i slowly run out of memory
I had a ton of mods running so i turned them all off and just tried replicating in vanilla, and i couldn't.
Then i turned them on slowly (well kinda slowly i did enabled all of lazywizards mods all at once) until i could replicate the slowdown.

Firstmods:
commonradar 2.4c
console commands 3.0 WIP 6
lazylib 2.2

then added
dynasector 1.4.6
no slowdown

then added
zz graphics lib 1.2.1
a bit of slowdown but after exiting refit would speed back up. No audio stuttering and no problems saving afterwards.

finally added shadowyards 0.7 and got the slowdown that sticks around after exiting refit, and causes music and sounds to clip, and stutter, and makes it so i can't save. when i try it goes a bit and then hangs forever (i just have to close it from outside the game)

So possibly relevantly I don't know if this is shadowyards specific or a quirk of the combined mods. I'm going to test more, but i wanted to find out if there is a way to see what is eating up memory to try and diagnose faster.

I've tried saving after a bit of the slowdown starts (and stays on campaign screen) and then reloading the save to see if that resets the required amount of time before unsavable happens. it doesn't. I have to close Starsector all the way, and load the save again.
Logged
Itches are scratched. Back-rubs are savored.

MesoTroniK

  • Admiral
  • *****
  • Posts: 1731
  • I am going to destroy your ships
    • View Profile
Re: Running out of memory
« Reply #1 on: September 19, 2018, 04:20:06 PM »

What are your system specs?

Are you allocating more RAM to SS than the default?

What was the "ton of mods" you were using?

Anyways you can view how much RAM is being used by looking at the top of the Console Commands window in-game.

CopperCoyote

  • Captain
  • ****
  • Posts: 451
    • View Profile
Re: Running out of memory
« Reply #2 on: September 19, 2018, 05:43:50 PM »

It's the legion 520y laptop
Intel Core i7 7700  Nvidia GeForce GTX1050Ti 4 GB graphics card 16 GB RAM

I had more mods running but i could replicate running out of memory with only:
commonradar 2.4c
console commands 3.0 WIP 6
lazylib 2.2
dynasector 1.4.6
zz graphics lib 1.2.1
shadowyards 0.7

I noticed the memory tool in the console mod, and it's at the default 1.5 GB. when i spend a lot of time in the refit screen it eventually eats it all, and the game is using all 1.5 GB. Before i added shadowyards it'd speed back up after returning to the campaign screen.  I should test with a different faction mod for the sake of completeness.
Logged
Itches are scratched. Back-rubs are savored.

MesoTroniK

  • Admiral
  • *****
  • Posts: 1731
  • I am going to destroy your ships
    • View Profile
Re: Running out of memory
« Reply #3 on: September 19, 2018, 05:54:17 PM »

Do you have SS set to use your discrete video card and not the IGPU? That is important.

Anyways if you are running anything more than even the smallest mod list? You *need* to increase RAM allocation :)
http://fractalsoftworks.com/forum/index.php?topic=8726.0

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24125
    • View Profile
Re: Running out of memory
« Reply #4 on: September 19, 2018, 05:55:49 PM »

How easy is this to reproduce? If you're able to zip up a minimal set of mods that causes this, I could give it a try and then use jvisualvm (a java tool to look at a running JVM, including memory etc) to maybe see what's causing it.

I did take a quick look through Shadowyards source and didn't see anything that looks like a likely culprit, but I didn't see everything.

(Did see a few potentially dodgy things, for example MS_swacs has a static list of ships but it's not actually used, so that's fine. And MS_ArmorPiercePlugin plus a few other classes hang on to a static CombatEngine for some reason, but as far as I can tell that should not cause an unbounded leak; at worst would make the old combat engine hang around when it shouldn't... so, yeah, didn't see anything that jumped out.)
Logged

CopperCoyote

  • Captain
  • ****
  • Posts: 451
    • View Profile
Re: Running out of memory
« Reply #5 on: September 19, 2018, 06:46:55 PM »

Quote
Do you have SS set to use your discrete video card and not the IGPU? That is important.
I don't know how to do that so probably not.

I'll also allocate more system ram. i'll be able to see if ram usage drops over time if it isn't full.

Quote
How easy is this to reproduce? If you're able to zip up a minimal set of mods that causes this, I could give it a try and then use jvisualvm (a java tool to look at a running JVM, including memory etc) to maybe see what's causing it.

It is super easy to reproduce. anytime i spend 15-20 minutes in the refit screen it happens. I tested it with fewer mods this time and blackrock faction instead

list:
Blackrock Drive yards 0.9.1
console commands 3.0 WIP6 (to give my self ships to fiddle with for 20 minutes)
lazylib 2.2
zz graphicslib 1.2.1


It happens faster with carriers than with non-carrier ships more toward 15 minutes instead of 20. It happens both with mod and vanilla ships but seems to be a little faster with mod ships

Quote
(Did see a few potentially dodgy things, for example MS_swacs has a static list of ships but it's not actually used, so that's fine. And MS_ArmorPiercePlugin plus a few other classes hang on to a static CombatEngine for some reason, but as far as I can tell that should not cause an unbounded leak; at worst would make the old combat engine hang around when it shouldn't... so, yeah, didn't see anything that jumped out.)

The issue is from time in the refit screen so i don't think combat scripts would cause it.
I also tested if the faction's BGM may cause it too. So initially i was at a shadowyards base with their BGM but also tested at a hegemony base and a blackrock base. it didn't seem to affect the time to running out of memory.

Addendum: so i changed the ram allocation in VPRAM to 6 GB and after a 20 minute refit session it'd shot up to 2.6 GB used. after about 10 minutes of flying around in the campaign screen it slowly edged back down.

It seems to be working fine now, but it seems odd that the refit screen would be that ram hungry
« Last Edit: September 19, 2018, 07:23:29 PM by CopperCoyote »
Logged
Itches are scratched. Back-rubs are savored.

CopperCoyote

  • Captain
  • ****
  • Posts: 451
    • View Profile
Re: Running out of memory
« Reply #6 on: September 19, 2018, 08:26:30 PM »

I tested a while longer and refitted some more, and it never got past 3 gigs used, and it seems so long as i don't use all available ram it will decrease in usage over time.

I've zipped up the 4 mods i've used to test this. how should i get them to you, Alex?
Logged
Itches are scratched. Back-rubs are savored.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24125
    • View Profile
Re: Running out of memory
« Reply #7 on: September 19, 2018, 08:52:02 PM »

Thank you - hmm, how big's the zipfile? If email is an option, then fractalsoftworks [at] gmail [dot] com. Otherwise... I'm not actually sure. Not super familiar with mediafire/dropbox and so on. But, I guess if we're talking the latest-available versions of 4 mods, I could download them without too much trouble :)

Just to confirm, it happens with both BRDY and Shadowyards, right? And do you have to keep tweaking stuff in refit or can you just sit on the refit screen? Also, are you in refit in the campaign, or in a mission? Do you know if it happens if you're refitting in a mission?
Logged

CopperCoyote

  • Captain
  • ****
  • Posts: 451
    • View Profile
Re: Running out of memory
« Reply #8 on: September 20, 2018, 12:04:49 PM »

Quote
Just to confirm, it happens with both BRDY and Shadowyards, right? And do you have to keep tweaking stuff in refit or can you just sit on the refit screen? Also, are you in refit in the campaign, or in a mission? Do you know if it happens if you're refitting in a mission?

I never considered just sitting there doing nothing. I'm changing the loadouts while memory is being used up. This is also in the campaign. I never tested the missions refit screen.

I'll test just sitting idle in the refit screen and see if it uses several gigs that way too.

I've also sent a link to the zip.
Logged
Itches are scratched. Back-rubs are savored.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24125
    • View Profile
Re: Running out of memory
« Reply #9 on: September 20, 2018, 12:07:07 PM »

Thank you for the info and for the email! Will check it out as soon as I get a chance.
Logged

CopperCoyote

  • Captain
  • ****
  • Posts: 451
    • View Profile
Re: Running out of memory
« Reply #10 on: September 20, 2018, 12:56:38 PM »

Sure thing. Happy to help.

I tested sitting in refit idle for half an hour and it got up to 1.3 gigs used which may or may not have caused everything to go all wonky before i upped the ram allocated. So it seems the issue is at least partially related to when i'm changing the ships themselves.

Short of putting my ram allocated back to default i'm not sure how i'd test the refit screen in the missions. I look at the ram used with the console after exiting refit an flying around in the campaign screen.
Logged
Itches are scratched. Back-rubs are savored.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24125
    • View Profile
Re: Running out of memory
« Reply #11 on: September 20, 2018, 04:18:05 PM »

Gave this a go, and unfortunately can't reproduce the problem. Spent maybe 15 minutes refitting a Karkinos, running simulation, switching to different ships, etc. Memory use from task manager goes up to 1300 (which is fine) but a JVM monitoring tool shows the memory usage is normal and I'm not seeing anything that would indicate a leak. Was also able to save without any issue after doing this. So - this is kind of weird!
Logged

CopperCoyote

  • Captain
  • ****
  • Posts: 451
    • View Profile
Re: Running out of memory
« Reply #12 on: September 20, 2018, 07:09:32 PM »

I wonder if it is particular to my machine then.

At any rate upping the system memory allocated fixes it for me, and it doesn't get stuck so long as it doesn't max out the memory.
Thank you very much for looking at it.
Logged
Itches are scratched. Back-rubs are savored.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24125
    • View Profile
Re: Running out of memory
« Reply #13 on: September 20, 2018, 07:41:44 PM »

Thank you for putting in the time and effort helping diagnose it!
Logged

MesoTroniK

  • Admiral
  • *****
  • Posts: 1731
  • I am going to destroy your ships
    • View Profile
Re: Running out of memory
« Reply #14 on: September 20, 2018, 08:41:40 PM »

Hey Copper Coyote, sorry got back to you late regarding this. But yea try setting SS to use your discrete video card of your laptop instead of the IGPU following this guide.
http://fractalsoftworks.com/forum/index.php?topic=13409.msg226173#msg226173

I wonder if it will change the results of this problem you are having. Regardless doing so will make the game run better so is a good idea to begin with anyways :)
Pages: [1] 2