ID:119413
 
Resolved
Dream Seeker was holding onto memory for unneeded icons for much longer than it should have, impacting games that used relatively few but large icons. Icons that haven't been used in 5 minutes are now unloaded by the garbage collector.
BYOND Version:490
Operating System:Windows 7 Pro 64-bit
Web Browser:Chrome 14.0.835.187
Applies to:Dream Seeker
Status: Resolved (493)

This issue has been resolved.
Descriptive Problem Summary:
Something is seriously wrong with Dream Seeker and I think it is memory related. Memory usage climbs up and never goes back down.

People are always complaining about lag and it's getting to the point where I am literally going insane. I've done everything I can think of to reduce lag on Feval. It uses less than 6% CPU with 20 players, less than 3% RAM, and like less than 250kb of bandwidth a second on a server that runs at 60Mbps. I just can't figure out what is going on. I mean, the game should support hundreds of players with zero lag. The only thing I could think of is client-side lag.

When I myself started to lag, I opened Task Manager up and DS was using 150mb of memory and just kept going up and up (slowly, though).

I think every icon is saved into memory and is never removed, but I'm not sure.

So, I'm assuming once memory usage gets high enough that it takes up a good percentage of a player's RAM, they start to lag. That's all I can think of. Maybe people lagging isn't related to the memory stuff, I don't know, but, this is an issue nonetheless.

Numbered Steps to Reproduce Problem:
Play a game for awhile (Feval for example), see memory usage climb and never go down.

Does the problem occur:
Every time? Or how often? All the time.
In other games? Yes.
In other user accounts? Yes.
On other computers? Yes.
Loaded icons do get released over time when they're no longer in use, so that wouldn't be it. It's hard to say without taking a closer look. Obviously client memory use would have no impact on actual lag (that is, network speed) unless you're actually hosting in DS.
Lummox JR wrote:
Loaded icons do get released over time when they're no longer in use, so that wouldn't be it. It's hard to say without taking a closer look. Obviously client memory use would have no impact on actual lag (that is, network speed) unless you're actually hosting in DS.

Client memory wouldn't make the server lag, sure, but it would make their computer lag. Everybody's client using up so much memory that their computer can't even run the game properly is worse than the server lagging.

I asked one player that was lagging how much memory was being used on their computer after they complained about lag and they said close to 70% (and dreamseeker.exe was only using 90mb at that time). Of course Dream Seeker isn't fully to blame for that percentage, but the less memory it uses, the less memory the computer will be using.

I mean, 150mb is not a whole lot compared to modern retail games that use like 600mb, but a lot of people play BYOND games because they have crappy computers. But honestly, a simple 2D game shouldn't even be using 1/100th of the memory a massive 3D game uses.

This probably isn't even why people are complaining about lag. But maybe I'm being hopeful that there is a big problem here somewhere and it being fixed will remove this performance problem. Something is seriously wrong with the BYOND software somewhere, and it's getting discouraging.
Does the game use any transparent graphics? Try toggling hardware mode through the pager.
Falacy wrote:
Does the game use any transparent graphics? Try toggling hardware mode through the pager.

Yes, the game uses transparencies. I think it's safe to say all games released after alpha-transparencies were added to DM have it. I don't see how this could relate to memory leaks or out of control memory or whatever it going on here though. Not to say what you're referring to isn't a problem somewhere, but there is no way I am going to tell people one by one to toggle certain settings on and off. Telling people "check your delay and set it back to 0" was bad enough.

But to answer the question, for me personally, that setting is set to the right setting to get the best results.
Using transparent graphics definitely causes massive client sided lag in certain situations, but I haven't been able to produce a simple test case. Turning hardware mode off fixes that lag for me. Having it off also makes stretched graphics look a lot better, IMO. Though, I'm not sure if those 2 issues are related...

Are these lag complaints specific to the new BYOND version?

EDIT: Some memory usage notes
Falacy wrote:
Using transparent graphics definitely causes massive client sided lag in certain situations, though I haven't been able to produce a test case. Turning hardware mode off fixes that lag for me. Having it off also makes stretched graphics look a lot better, IMO. Though, I'm not sure if those 2 issues are related...

As far as I can tell, unselecting the option makes me lag.

Are these lag complaints specific to the new BYOND version?

There seem to be even more complaints since 490, but mainly due to their inputs not being registered properly. Which is something entirely different.

Did you see my EDIT?
Falacy wrote:
Did you see my EDIT?

Yeah. 250mb doesn't seem like much compared to 1gb. But we're talking about simple 2D games that are only 4mb to maybe 10mb in size. I mean (don't quote me on this), the Super Nintendo only had like 128kb of memory and we're talking about our games using 250mb of memory. I mean, the Nintendo 64 wouldn't even have enough memory.
Aaiko wrote:
I mean, the Nintendo 64 wouldn't even have enough memory.

Indeed. Dungeons of Dredmor uses around 175mB. Terraria uses almost 370mB. And that's just from a quick start, not playing them for 5 hours.
So far what I'm seeing confirms that memory is growing--though not steadily--and isn't much being given back. It's very hard to debug that from a remote client however. I think to make real headway it would help a lot to have a copy of the host files, and even more to have the source--particularly so I can see how your interface is constructed and which elements I might be dealing with. If you're amenable to either option you can send me files, or a link thereto, at [email protected].
Lummox JR wrote:
So far what I'm seeing confirms that memory is growing--though not steadily--and isn't much being given back. It's very hard to debug that from a remote client however. I think to make real headway it would help a lot to have a copy of the host files, and even more to have the source--particularly so I can see how your interface is constructed and which elements I might be dealing with. If you're amenable to either option you can send me files, or a link thereto, at [email protected].

I sent some stuff to you. By the way, you can see the output bug in action as well. Clicking the "# players online" brings down a list and shrinks the chat under it, but the chat's scrollbar doesn't update properly. And when it's shrunk, scrolling is all wonky.