supertuxkart / stk-code

The code base of supertuxkart
Other
4.52k stars 1.06k forks source link

RAM usage doubles over time #2958

Open Arthur-D opened 7 years ago

Arthur-D commented 7 years ago

While RAM usage has gone considerably down since 0.9.2, I've found that playing many tracks in a row can more than double the RAM usage. Specifically, playing an all tracks Grand Prix shows that in the first track STK might use ~350-400 MB RAM, and by the time I'm finished with all 21 current standard tracks it uses somewhere around ~900-950 MB RAM. This is not bad for most desktop users, but for devices like phones and tablets 950 MB could easily be half of the system's RAM.

Further testing Benau asked me to do shows that textures appear to be cleaned up properly between tracks, and that something else is probably the culprit. The above test results happened at near maximum graphics fidelity, but turning graphics all the way down, and sounds and networking off RAM usage started at around ~300-350 MB and went up to ~550-600 MB RAM. This is quite a lot better but unless there are lots of things that make sense to cache between races it could probably be improved still.

Also note that RAM usage does not appear to increase if the game is paused or idling, so no leaks are apparent unless more tracks are played.

Anyway, this is low priority as most users would have no problems, and mobile users are not very likely to play lots of tracks in a row since in my experience it's rather tiring to play on a phone (but fun too). But I figured it's best to document it for posterity in case someone wants to have a look.

Benau commented 7 years ago

Sorry Arthur_D I cannot reproduce on 2(3) machines (linux + amdgpu/ (same machine different card) hd3000 + nvidia gt240 in windows), I race all with 20 karts with all track grand prix (though I use change camera to ai and give up race after 3 laps end so I can do something else). And in linux ram usage is 200-300MB until the end, and in windows it's 900mb to 1.3GB(intel), nvidia ram usage is same in linux.

And music + sound and network all are on.

And fun fact:

  1. Grand island use the most ram (and vram) on all machines.

  2. I can even enable hd-textures + advanced pipeline in hd3000 with 1024x768 and finish the grand prix, so you don't need to raise the minimum requirements anytime soon.

Benau commented 7 years ago

one more fun fact, seems that AI controlling adiumy will have ~80% of the time finish the race last

Benau commented 7 years ago

Unrelated: I raced 20 watching-ai-kart playing all tracks grand prix (time trial, so no gifts, fair test) with hw-skinning-on successfully in hd3000 windows, and adiumy kart has the least grand prix points again in the end!