Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Linux]Neverending Memory Leak Problem #2873

Open
mezka opened this issue Dec 11, 2024 · 2 comments
Open

[Linux]Neverending Memory Leak Problem #2873

mezka opened this issue Dec 11, 2024 · 2 comments

Comments

@mezka
Copy link

mezka commented Dec 11, 2024

There's all kinds of memory leaks in the Linux Client, that's why at the beginning of the match the FPS are great but as long as the match progresses the FPS gets worse.

As the executable gets assigned more and more memory, less cache hits you get and that's why the performance tanks, it doesn't matter if you have 32GB memory, your CPU cache gets filled and cache hit ratio tanks, then you need to access the RAM for everything, and then it is that you get framelimited by RAM access speed/stuttering.

I tested this thoroughly on a i5 4690k w/ 6MB cache.

At the beginning I get framelimited to 120fps and as the game progresses and starts leaking, cache miss ratio increases and you get FPS stutter.

I get >120fps at the start and 25 fps at 1hr time.

This is the reason of the FPS stutter, its the memory leaks causing cache invalidation (and cache pollution), and then every game action requires fetching from ram.

If you have a CPU with big caches you will suffer this less so.

DDR3 will suffer this the most, with DDR4 being lesser, and DDR5 being less so.

Now please run Valgrind in your C++ codebase.

valgrind --leak-check=full ./your_program

==12345== LEAK SUMMARY:
==12345== definitely lost: 512 bytes in 1 blocks
==12345== indirectly lost: 0 bytes in 0 blocks
==12345== possibly lost: 0 bytes in 0 blocks
==12345== still reachable: 32 bytes in 1 blocks
==12345== suppressed: 0 bytes in 0 blocks
==12345==
==12345== 1 errors in context 1 of 1:
==12345== At 0x4C2BB55: malloc (vg_replace_malloc.c:309)
==12345== by 0x4006A7: main (myprogram.cpp:10)
==12345== by 0x4005D3: _start (in /lib/x86_64-linux-gnu/libc-2.27.so)
==12345==
==12345== LEAK SUMMARY:
==12345== definitely lost: 512 bytes in 1 blocks
==12345== indirectly lost: 0 bytes in 0 blocks
==12345== possibly lost: 0 bytes in 0 blocks
==12345== still reachable: 32 bytes in 1 blocks

That will tell you in what line you have the memory leaks, and then you can fix them.

see: ==12345== by 0x4006A7: main (myprogram.cpp:10)

@krabodyan
Copy link

i think i also have this bug, after 25 minutes of game i have about 10 fps and only restart helps

@rzaba0
Copy link

rzaba0 commented Dec 11, 2024

Sounds like ValveSoftware/steam-for-linux#11446

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants