View Issue Details

IDProjectCategoryLast Update
0019011AI War 2Bug - GameplayMay 26, 2017 3:07 pm
ReporterBadgerBadger Assigned ToChris_McElligottPark  
Status resolvedResolutionfixed 
Product Version0.104 
Fixed in Version0.300 - Welcome Early Access Kickstarter Backers! 
Summary0019011: Leaving the game paused overnight prevents you from unpausing
DescriptionI had AI War running on my linux system, and I left the game paused overnight.

In the morning the game is unusable; some of the GUI icons are clickable, but they spawn blank buttons. The "unpause" button definitely doesn't work.

Also the process seems to be taking up a lot of CPU and memory:

  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
                                                                                                                                                                                                           
10687 user 20 0 5142868 1.293g 70308 R 55.1 8.4 686:33.25 AIWar2Linux.x86


Normally I see values like
  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
21217 user 20 0 4337240 381848 69688 R 185.4 2.4 0:41.82 AIWar2Linux.x86


Some sort of memory leak?
TagsNo tags attached.

Activities

gavin144

Mar 4, 2017 12:34 pm

reporter   ~0045887

I believe this is related to an issue I've been attempting to gather info on, but it's been a bit slow. It turns out performance on my machine is even better than I had reported on the forum, but after a certain amount of gameplay time both the graphics framerate and the underlying simulation rate slow down massively. I've gotten about to the point of having the simulation run at half speed, and framerates drop to 10-15 fps after a couple of hours. I think your unresponsiveness may be an extreme case. On my machine a save and reload does not improve the situation, but simply restarting the game brings framerates back to 60 and the underlying sim speed back to normal.

bladeravinger

Mar 5, 2017 12:30 am

reporter   ~0045888

i have noticed a little something like this on my windows 10

i ignored it not really noticing, just assuming the game was unfolding behind the scenes, i start a game with 200+ frames, by 30 mins in 80~ by 1 hour 30~ the frame degradation i have seen seems to level off, this is why i assumed i was just the game unfolding (AI making more actions to react to my aggression), lowest i have seen the Frame rate hit is 15 FPS (using Steams FPS overlay, i see the green well)

keith.lamothe

Mar 6, 2017 8:05 am

administrator   ~0045892

If any of you have saves that demonstrate this, could you attach them?

Thanks :)

BadgerBadger

Mar 6, 2017 9:20 am

manager   ~0045895

The issue is more that the problem shows up after leaving the program on for many hours. Would a save file capture that? I suspect closing the game and reloading it would remove the issue.

BadgerBadger

Mar 6, 2017 10:32 am

manager   ~0045896

I ran an example this morning. I conquered the first planet, upped the AI progress a bit then spawned a wave (so there would be more things in the galaxy), then paused the game. I saved the game about 2 minutes after pausing it, which I have uploaded. Just in case, I have a few mods in there (a Give Science button, and my Ark is set to be extra strong).

Here is my memory usage over an hour:
Mon Mar 6 09:27:05 EST 2017
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
user 3416 106 2.4 4349316 400980 pts/0 Sl+ 09:22 4:21 ./AIWar2Linux.x86_64

Mon Mar 6 10:29:06 EST 2017
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
user 3416 84.8 2.9 4377212 482024 pts/0 Sl+ 09:22 56:06 ./AIWar2Linux.x86_64

Observe that it's using 80MB more memory. If it was left on overnight, that would be nearly a GB if the usage continues at the same rate.

BadgerBadger

Mar 6, 2017 10:33 am

manager  

NewSave_2.save (771,410 bytes)

BadgerBadger

Mar 6, 2017 10:52 am

manager   ~0045897

Here is the memory usage when I ended my experiment:
Mon Mar 6 10:51:06 EST 2017
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
user 3416 85.1 3.1 4387144 515836 pts/0 Rl+ 09:22 75:01 ./AIWar2Linux.x86_64

So in 90 minutes of being paused, AI War 2 used 100MB more memory.

Chris_McElligottPark

Mar 6, 2017 4:01 pm

administrator   ~0045909

This is something we should defer investigating until after we upgrade to a later version of Unity 3D. There is quite likely a very slow memory leak in unmanaged memory there.

If this was managed memory (aka Keith's data), then it would crash a lot sooner, I'd think.

We can run tests to see if there's a general growth in managed memory inside the game, though, and if there is we can find out some things from there. But for now, let's table this until a later version of Unity.

I don't want it to fall off the table in terms of things to investigate, though, so let's leave it open for sure.

BadgerBadger

Mar 6, 2017 4:03 pm

manager   ~0045910

That's fine. Post here when you want this issue to be examined again

Chris_McElligottPark

Mar 6, 2017 4:07 pm

administrator   ~0045912

Will do! Thanks for reporting it.

BadgerBadger

May 20, 2017 9:50 am

manager   ~0046196

I happened to leave a game paused overnight, and observed the memory usage climb steadily, and the game was hiccuping when I unpaused it. An overall improvement though, it wasn't as bad. This was version .201

Chris_McElligottPark

May 26, 2017 3:07 pm

administrator   ~0046200

* Fixed a teeny tiny little typo that was causing huge performance degradation for creation of pooled objects in general, as well as a memory leak every time an object was pulled from the pool.

Thanks! If you still see a memory leak later, please do let us know. Probably worth a separate issue at that point, since at least this leak (which was huge) is fixed now.

Issue History

Date Modified Username Field Change
Mar 4, 2017 11:51 am BadgerBadger New Issue
Mar 4, 2017 12:34 pm gavin144 Note Added: 0045887
Mar 5, 2017 12:30 am bladeravinger Note Added: 0045888
Mar 6, 2017 8:05 am keith.lamothe Note Added: 0045892
Mar 6, 2017 8:05 am keith.lamothe Assigned To => keith.lamothe
Mar 6, 2017 8:05 am keith.lamothe Status new => assigned
Mar 6, 2017 9:20 am BadgerBadger Note Added: 0045895
Mar 6, 2017 10:20 am BadgerBadger Description Updated
Mar 6, 2017 10:32 am BadgerBadger Note Added: 0045896
Mar 6, 2017 10:33 am BadgerBadger File Added: NewSave_2.save
Mar 6, 2017 10:52 am BadgerBadger Note Added: 0045897
Mar 6, 2017 4:01 pm Chris_McElligottPark Note Added: 0045909
Mar 6, 2017 4:01 pm Chris_McElligottPark Assigned To keith.lamothe => Chris_McElligottPark
Mar 6, 2017 4:01 pm Chris_McElligottPark Status assigned => feedback
Mar 6, 2017 4:03 pm BadgerBadger Note Added: 0045910
Mar 6, 2017 4:03 pm BadgerBadger Status feedback => assigned
Mar 6, 2017 4:07 pm Chris_McElligottPark Note Added: 0045912
Mar 6, 2017 4:07 pm Chris_McElligottPark Status assigned => feedback
May 20, 2017 9:50 am BadgerBadger Note Added: 0046196
May 20, 2017 9:50 am BadgerBadger Status feedback => assigned
May 26, 2017 3:07 pm Chris_McElligottPark Note Added: 0046200
May 26, 2017 3:07 pm Chris_McElligottPark Status assigned => resolved
May 26, 2017 3:07 pm Chris_McElligottPark Fixed in Version => 0.300 - Welcome Early Access Kickstarter Backers!
May 26, 2017 3:07 pm Chris_McElligottPark Resolution open => fixed