ID:2445175
 
Resolved
The client garbage collector has been improved to deal with games that use a lot of large icons, encouraging them to let go of unused icons sooner as memory use goes up.
BYOND Version:512
Operating System:Windows 10 Pro 64-bit
Web Browser:Chrome 73.0.3683.86
Applies to:Dream Seeker
Status: Resolved (512.1467)

This issue has been resolved.
Descriptive Problem Summary:

So, assuming someone has an empty cache when joining my game. After a few games using different characters - any future icons will no longer render in. and instead cause horrendous lag (Or crash the game completely). If they relog, and do NOT delete the cache, the issue appears quicker.

Another thing to note is, the bigger the icon is the quicker this issue with occur. - aka a few of the things in my game use icons 256x256 (the old max size), with about 10+ states. Which causes the issue much more frequently.

Numbered Steps to Reproduce Problem:

-I've sent Lummox the source to a game with the same issue just easier to replicate there.

the steps are just simply, clicking on each of the characters. Eventually it will just break, it's random but WILL occur by the time you click all the characters.

Code Snippet (if applicable) to Reproduce Problem:


Expected Results:
icons showing, not causing lag.
Actual Results:
Icons do no show/render, causes insane lag for that client.
Does the problem occur:
Every time? Or how often?
Depending on playtime, everytime.
In other games?
Every sidescroller game has this issue, in one form or another.
In other user accounts?
On other computers?

When does the problem NOT occur?

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
Has occured since I first started making sidescroller games back in 2010.
Workarounds:

Restarting the game and deleting the cache will fix it temporarily.
I tried working with your test project, after first disabling the no-guest code, but I found that most of the characters were locked. I clicked on all the characters I could, but experienced no bug.

I think to make any headway with your source, I need you to tell me how to unlock all the available characters.
If you click the interface button called "Arena", you can do it from there.
What I'm seeing here is definitely memory depletion. If you open up Options & Messages you'll see messages about icons not loading from the cache; that's a dead giveaway.

I had some experimental client garbage collection improvements in a while back, but I took them out again and I believe it was because the GC was firing too often. I've made some changes to the algorithm involved and also made it more lenient on memory use, so I believe that will make a difference in your project. In tests I'm seeing this is doing the trick.

The old algorithm fired after a certain number of new appearances or new icons since the last check, and did not take icon memory into account. The experimental one I tried involved also triggering the GC if icon memory was above a certain threshold, but of course past that point it kept triggering so that's no good.

The new one I've got will trigger on the same conditions as the original, plus it'll trigger if there's been a fairly substantial increase in icon memory since last time, plus it'll trigger if icon memory is over a certain high threshold and ANY new icons have been allocated. During the garbage collection, the time that an appearance or icon can stick around is diminished based on how much icon memory is allocated, with light time reductions for moderate usage and draconian ones for high usage.
Lummox JR resolved issue with message:
The client garbage collector has been improved to deal with games that use a lot of large icons, encouraging them to let go of unused icons sooner as memory use goes up.
Is this a client side fix or a server side? it seems like a huge deal

edit:nvm i see its client lol whoops