CTD trunk nightly 1.83.0.6610-150824-1274242

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 5397
Joined: Wed Feb 28, 2007 7:54 am

Re: CTD trunk nightly 1.83.0.6610-150824-1274242

Post by another_commander » Thu Aug 27, 2015 6:25 am

Cody wrote:
Cody wrote:... time to try without OXPs, I suppose.
No difference in strict mode - still occurring. <scratches head - again>
I am surprised that it seems to happen only when minimizing the window. I can't see how or why would this be in any way relevant. Are you sure that it happens only and exclusively in the cases when you minimize it, Cody? Since it appears to be quite frequent on your system (I am trying to reproduce it here and haven't made it so far), would you be able to try some normal play and see if it happens anyway when docked?

User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 13678
Joined: Sat Jul 04, 2009 9:31 pm
Location: Corke's Drift
Contact:

Re: CTD trunk nightly 1.83.0.6610-150824-1274242

Post by Cody » Thu Aug 27, 2015 12:06 pm

I've been at it most of the night, and it is still as described. I can reproduce it reliably (maybe one in four/five) in trunk when docked, both paused and unpaused. I've been unable to reproduce again it in 1.82, so that was a one-off, it seems - the worst sort.

@cim: it would've been the nightly immediately before 1.83.0.6610-150824-1274242 - I update whenever there is a new nightly. I'd not seen it before. The players build.

@a_c: I play in fullscreen mode, not windowed, and it is this I minimise. I've not seen any app use over 8GB of RAM - it's crazy! I am playing normally, running cross-chart contracts - this only occurs when minimised (which in my normal play, is always docked). I've not seen it happen once when in normal fullscreen mode. If I re-maximise it just before Oolite freezes, the RAM usage drops back to normal very quickly.
Diziet Sma wrote:The entire Sysinternals range of tools is very useful..
<nods> Indeed!

I need coffee!

another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 5397
Joined: Wed Feb 28, 2007 7:54 am

Re: CTD trunk nightly 1.83.0.6610-150824-1274242

Post by another_commander » Thu Aug 27, 2015 12:20 pm

Sorry, you lost me there: How exactly do you minimize full screen? And what do you mean by "normal full screen"? There is only one full-screen mode and that takes up the entire screen and does not have any kind of window control. Maybe you are using a hotkey like WinKey+Down Arrow? Can you clarify this bit please?

User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 13678
Joined: Sat Jul 04, 2009 9:31 pm
Location: Corke's Drift
Contact:

Re: CTD trunk nightly 1.83.0.6610-150824-1274242

Post by Cody » Thu Aug 27, 2015 12:24 pm

By normal, I meant my normal play mode - ignore. Start+m minimises any apps to the taskbar - been using it for years.

another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 5397
Joined: Wed Feb 28, 2007 7:54 am

Re: CTD trunk nightly 1.83.0.6610-150824-1274242

Post by another_commander » Thu Aug 27, 2015 1:26 pm

Aha! OK, with this additional information, I have successfully reproduced the problem. Thanks Cody, that last bit has actually been very helpful. I will guess that you have the rotating player ship set to show on the status screen?

Apparently there is a memory leak in the Commander Status screen, at least (and most likely, exclusively) on Windows. Observations:
  • The leak triggers only if one is in full screen on the F5 gui screen and minimizes the game by use of a hotkey, like Cody's WinKey+M (all apps minimized) or my WinKey+DnArrow (active app minimized).
  • Windowed mode is fine and does not leak.
  • Other GUI screens seem to not leak. Haven't tested them all though.
  • To experience the leak at maximum force, have your player ship set to show on the F5 screen - memory then goes away real quick.
  • The leak stops immediately once the game regains focus. With the player ship showing on F5, there seems to be a pause for a few seconds, then the ship continues to rotate once memory has been freed.
  • Pausing the game is irrelevant to this problem.
  • The leak is present in 1.82 too and is reproduced in the very same way as with trunk. Basically, it's been with us all along.
Pic of memory usage while having the F5 screen in fullscreen-minimized:
Image

Temporary work-around: Do not be on the F5 screen if you want to minimize the full screen window, so that when you do minimize it, the leak won't trigger.

User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 13678
Joined: Sat Jul 04, 2009 9:31 pm
Location: Corke's Drift
Contact:

Re: CTD trunk nightly 1.83.0.6610-150824-1274242

Post by Cody » Thu Aug 27, 2015 1:33 pm

Phew! I was beginning to doubt myself - thanks! Curious that I'd never noticed it before though - and yes, I have the rotating player ship on F5.

User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4018
Joined: Fri Nov 11, 2011 6:19 pm

Re: CTD trunk nightly 1.83.0.6610-150824-1274242

Post by cim » Thu Aug 27, 2015 7:51 pm

another_commander wrote:Apparently there is a memory leak in the Commander Status screen, at least (and most likely, exclusively) on Windows.
The interesting thing is that it's not from your descriptions actually a leak, which would be an irritating thing to deal with but usually at least possible to track down.
another_commander wrote:[*] The leak stops immediately once the game regains focus. With the player ship showing on F5, there seems to be a pause for a few seconds, then the ship continues to rotate once memory has been freed.
Oolite is keeping track of all the memory and when the whatever-it-is stops, garbage collection releases it properly. It's as if being minimised on the F5 screen is somehow suspending garbage collection. (Messing with the autorelease pools, perhaps?)

But why just on the F5 screen? If it were ship models I'd expect F3F3 and many mission screens to have the same issue, and maybe even F7 with its planet - not to mention "in flight"! If it was text density F8 is quite a bit worse.

another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 5397
Joined: Wed Feb 28, 2007 7:54 am

Re: CTD trunk nightly 1.83.0.6610-150824-1274242

Post by another_commander » Thu Aug 27, 2015 8:43 pm

cim wrote:But why just on the F5 screen? If it were ship models I'd expect F3F3 and many mission screens to have the same issue, and maybe even F7 with its planet - not to mention "in flight"! If it was text density F8 is quite a bit worse.
I have really no idea why just on the F5 screen and, even more so, no clue why windowed mode doesn't leak, when fullscreen does. Full screen on Windows is nothing more than a window sized to desktop dimensions, with borders and titlebar removed. It should behave exactly like any other normal window. I am really puzzled.

There is one solution, which is quite common practice in other games and for which I had already written code in the past, but never commited it: disabling of the Windows key when in full screen. This would probably also simplify a lot all the code that handles hotkey switching of the game window from one monitor to another, but I would prefer to find the actual root cause of the leak problem, rather than circumvent it and only disable the Windows key as a last, desperate solution..

User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 13678
Joined: Sat Jul 04, 2009 9:31 pm
Location: Corke's Drift
Contact:

Re: CTD trunk nightly 1.83.0.6610-150824-1274242

Post by Cody » Thu Aug 27, 2015 9:13 pm

<chortles> Gotta love foxing the Admiralty!

User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4018
Joined: Fri Nov 11, 2011 6:19 pm

Re: CTD trunk nightly 1.83.0.6610-150824-1274242

Post by cim » Fri Aug 28, 2015 6:49 am

I suppose another thing about the F5 screen is that it does route planning. So does F6 do it if you have an ANA route plotted ... and does F5 do it if hyperspace and current systems are the same?

another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 5397
Joined: Wed Feb 28, 2007 7:54 am

Re: CTD trunk nightly 1.83.0.6610-150824-1274242

Post by another_commander » Fri Aug 28, 2015 7:56 am

Guys, I think I got it. Stand by for a tentative fix in trunk in a while...

Edit: Commit e12a9ab should hopefully deal with this. I still haven't got a full explanation of why it happens under the conditions it happens, but the fix is simple and straightforward. Can someone <glances at Cody> please confirm that it works and try to playtest for a while to ensure nothing else has been broken?

User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 13678
Joined: Sat Jul 04, 2009 9:31 pm
Location: Corke's Drift
Contact:

Re: CTD trunk nightly 1.83.0.6610-150824-1274242

Post by Cody » Fri Aug 28, 2015 12:06 pm

I'll be about it when tonight's nightly hits (so tomorrow morning) - unless you've got a .exe handy?

another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 5397
Joined: Wed Feb 28, 2007 7:54 am

Re: CTD trunk nightly 1.83.0.6610-150824-1274242

Post by another_commander » Fri Aug 28, 2015 12:20 pm


User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 13678
Joined: Sat Jul 04, 2009 9:31 pm
Location: Corke's Drift
Contact:

Re: CTD trunk nightly 1.83.0.6610-150824-1274242

Post by Cody » Fri Aug 28, 2015 12:29 pm

Sweet! Muchas gracias, I'll get the coffee on!

User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 13678
Joined: Sat Jul 04, 2009 9:31 pm
Location: Corke's Drift
Contact:

Re: CTD trunk nightly 1.83.0.6610-150824-1274242

Post by Cody » Fri Aug 28, 2015 2:06 pm

All good so far - ticking over happily at 1.4GB as I type (docked, F5, minimised).

Post Reply