Page 1 of 1

Gradual fps slowdown 0.9.26

Posted: Sat Feb 04, 2006 19:10
by Enjay
I was playing through "Operation Overlord" on UV. When I started, my frame rate, even on the beach was pretty good. By the time I got into the bunker complex near the end, I noticed that my frame rate was quite low - less than 100fps. As I progressed, I was aware that the frame rate was slowly dropping. I'm not sure, but I think it may have taken a bit of a dive every time I died and quickloaded - which was happening quite a lot - my health was in single figures. Pretty soon, my fps was also in single figures. I tried messing with a few options, turning dynamic lights on and off and various other things, but no significant difference. I even started a new game and then reloaded my save (without quitting GZdoom) and the frame rate was even worse (by this time I was down to 2 or 3 fps). Anyway, I quit GZdoom, restarted and loaded my save and was able to complete my game without dipping below 200fps.

So, a prolonged game (I'd been playing about 40 minutes when the severe slowdown happened) with repeated save/loads seems to be, I dunno, leaving additional stuff in memory or something and slowly clogging the game to the point where it can become unplayable, but a quit, restart and reload clears the problem.

Posted: Tue Feb 07, 2006 21:07
by Enjay
A bit more info:

I repeated the process with 0.9.27. This time, no slowdown. However, I was playing with precache gl textures with 0.9.26 when I got the slowdown and without precache with 0.9.27. The next time I've got a spare hour, I'll sit down and do it again with 0.9.27+precache and see what happens. From what I've experienced so far, the problem has either been fixed with the new version or is down to texture precaching. Or possibly it's something less obvious that I simply can't think of.

Posted: Tue Feb 07, 2006 22:12
by Deathlike2
II'm not sure what to tell you, but you could try updating your video card drivers and see if that makes a difference...

On this topic in particular..

Potentially, this could just be a memory consumption problem... something either in the load/save sequence is only increasing the problem (even changing levels can contribute to the problem)... it sounds like a memory leak is going on though. I'm not sure whether or not you have low RAM (around 512MB or less) and/or running XP.. but those may factor in.. if you could provide that, that might help eliminate some variables...

If the problem is the result of the option mentioned, perhaps the memory consumed is not being released on a save/load or a different level is being loaded...

Posted: Tue Feb 07, 2006 22:19
by Graf Zahl
Checking in the Windows Task manager can also give some information. Is the memory usage more or less constant or does it increase gradually?

Posted: Tue Feb 07, 2006 22:42
by Deathlike2
Memory usages seems rather constant.. but over time, it does increase.. the more levels you play.. when you come back to a certain level again.. you will always have consumed more memory than the first time you were at that level. I suspect this is normal (somewhat, there is variation of coruse), but the problem is that possibly that when you are consuming lots of memory precaching stuff, that some of it is not emptied (I could be totally wrong though). There's also hitting the wall where you consume more memory that it has to spill over into virtual memory (which most likely can happen and would be result in poor performance)... which I'm not sure if Enjay is noticing the hard drive being accessed, but I presume you can develop a level with lots of hires textures in mind and easily magnify the problem.

Posted: Tue Feb 07, 2006 23:30
by Graf Zahl
There is a small leak somewhere. But finding it may be difficult.

There is a simple way to test whether the textures are responsible:

If it happens again, type 'GL_FLUSH' at the console. That frees all data loaded by the renderer and recreates only the things currently needed.

Posted: Tue Feb 07, 2006 23:39
by Enjay
OK, just had a quick play through again. 0.9.27 with pre-caching on. I didn't get the significant slowdown that I did last time. Possibly this was because I was playing much better and the game was therefor shorter and had less save/loading going on. However, by the time I finished, I was down to an average of about 80fps in the bunker when a quit, restart and reload sees me sitting around 200 most of the time.

I also had the task manager keep an eye on memory usage.

29,816K when sitting at the title screen
75,916 whilst watching the briefing
82,020 right at the start of play
84,588 still near the start, having wiped out a few bad guys and saved once
92,340 past the first fence on the beach
95,756 at the start of the minefield
103,548 at the base of the first tower before going in
104,660 into the main trench complex after the tunnel
106,140 trench area cleared
107,044 at the bottom of the second tower
107,572 exactly the same place after quicksaving twice
103,792 top of the second tower (yes, lower for some reason)
104,236 bottom of third tower
105,324 about to go into the prison/bunker complex
108,988 about 1/3 of the way through the bunker
112,712 about 2/3 of the way through
120,772 standing in front of the exit line waiting to quit

73,228 exactly the same place after quitting, restarting GZDoom and reloading a save

My driver is 81.95. Not quite the most recent, but one that has worked well for me so far. I believe 81.98 is the latest.

[edit]Ahhh dammit, your post about GL_FLush appeared whilst I was playing. Too late to test now. When I get a chance, I will do.[/edit]

Posted: Wed Feb 08, 2006 0:59
by Deathlike2
I'm think that you need to flush the textures whenever you load a new level.. however this works poorly for games with hubs (Strife/Hexen) unless you are not using hires textures....

I think what's happening is that when you are loading or starting a new game, presuming you were already playing the same level again (this is always the case when you are loading...).. the textures from playing the level previously are not being reused, rather the same textures are being recached (prior cache isn't being flushed) thus increasing the memory usage.

This is what I'm thinking is going on.

Hmm.. it might not be the textures... but loading a level will always cause memory consumption to go up (or starting a new game)... hmm perhaps memory is just not being deallocated for the previous level that was loaded?

Posted: Wed Feb 08, 2006 11:27
by Enjay
To clarify: All the above figures were collected on the same level during one unbroken session of GZdoom. There were quite a few save/reloads during the game - but not between every memory reading I gave. Usually there would have been saves, but I only loaded if I died, so sometimes that didn't happen. eg where I say "exactly the same place after quicksaving twice" I just sat there, hit F6 Y and then repeated. I waited 'til disk activity stopped then checked memory. I actually checked a few times and it seemed that a save meant around 200K extra was used. I have no real idea why the memory usage went down at one point. There were a few less actors active (about 10 or so - because they were dead) but there were none on screen either time and at the time when I got the lower memory usage, the view being rendered was far more complex than it was with the previous higher reading.

Oh, and to answer an earlier question 1GB RAM. XP Home, service pack 2 + all other updates.

Posted: Wed Feb 08, 2006 12:58
by Graf Zahl
Something is piling up without being deleted. But I have no idea what is happening here.
I just played the map with the task manager constantly open and over the 30 minuts I ran the level the memory usage increased by 5 MB. That's normal because the game needs to allocate some things on occasion that don't get deleted. But I have no idea where your numbers are coming from. For me the memory usage is constantly between 60 and 70 MB.

Maybe it's your driver version. I am still using 77.72, So far I haven't seen the need to upgrade that.

Here's a few interesting numbers (not related to this problem):

With dynamic lights on I get 34 fps when standing on the boat.
With dynamic lights off I get 43 fps.
And when I disable the radar script I get 55 fps.

I think I found the reason why this WAD performs so badly on slower computers...

Posted: Wed Feb 08, 2006 14:58
by Enjay
Hmmm, the radar gives the fps quite a big hit doesn't it. I'll have to check that when I get home tonight and see what my figures are like.

When you played with your relatively constant memory usage, were you using pre-cached textures like me?

Posted: Wed Feb 08, 2006 23:01
by Enjay
OK, some facts and figures

35 fps standing on the boat
37 fps after disabling dynamic lights
48 fps after disabling the radar. That's more of a hog than I thought it would be.

With pre-cache enabled, after running around the level for a bit, from 72,568K, I'd built up my memory usage, as reported by task manager, to 102,698. I brought down the console and typed GL_FLUSH. A second or two later I was down to 51,712K.

With pre-cache disabled, I started the level at 42,282K, managed to build it up to 85,276 through playing (well, just running around the level in god mode actually) and then reduce it back down to 43,364 with GL_FLUSH.

So, whatever GL_FLUSH flushes, that seems to be where the problem lies.

I suppose I'll update my drivers to the latest version at some point. I hadn't bothered because I saw little in the update that was relevant to my hardware. I suppose I could go back to the old ones, but last time I did that, it caused quite a few knock-on problems that took a while to iron out.

[edit]Just updated to the 81.98 drivers - no obvious difference to this particular problem.[/edit]