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

TF2 & TC2 leaks memory when connected to any server on wine & proton. #660

Open
10 of 13 tasks
vorsh opened this issue Aug 22, 2023 · 5 comments
Open
10 of 13 tasks

TF2 & TC2 leaks memory when connected to any server on wine & proton. #660

vorsh opened this issue Aug 22, 2023 · 5 comments
Labels
bug Something isn't working needs triage Needs to be organized tf2 Related to the TF2 live version and TC2

Comments

@vorsh
Copy link

vorsh commented Aug 22, 2023

Description

When running tf2 or tc2 inside wine (wine-stable, wine-staging, proton, etc..) and being connected to any server tf2 will allocate memory every second (or frame, tick, etc) until OOM. This issue is not present when running on windows. This issue is not present when unconnected.

Checklist

  • None of the open or closed issues document this problem.
  • This is a bug, not a new idea.
  • This is objectively a bug, and not something that people commonly disagree on.
  • This issue occurs on the latest Team Comtress release, or the master branch.
  • This issue occurs on the latest vanilla TF2 update.
  • This bug is in the code of the game, not in the textures, sounds, or other resources.
  • This issue is listed on the Source 1 official bugtracker.
  • This issue occurs with DirectX level 100.
  • This issue occurs when using no custom content.
  • This issue occurs when using start_tf2.bat (or start_server.bat) with no custom launch options.
  • This issue occurs when using a listen server (using the map command ingame).
  • This issue occurs when using a dedicated server.
  • This bug is in the internal procedures or tooling (e.g. the build process).

Reproduction

  1. Install steam (with chromium fix) & tf2 inside wine or use native steam client & proton tf2
  2. Start tf2
  3. Connect to any server, for example local itemtest
  4. Check how memory usage increases through either wine's taskmgr or in-game console command "memory" (check Heap Used:)

Screenshots

Example memory usage in tc2 after 30 minutes of afk
Screenshot_20230822_122742

Setup Details

Client Settings

  • Server or client: client
  • Operating system: arch linux 6.4.11-zen2-1-zen
  • Team Comtress version: 2.0.2
  • Custom content: mastercomfig low preset
  • Launch options:

Driver Version

  • Graphics driver: mesa 1:23.1.6-1, lib32-mesa 1:23.1.6-1, vulkan-radeon 1:23.1.6-1, lib32-vulkan-radeon 1:23.1.6-1
  • DirectX level: dxlevel 80-100. tested on galliumnine, dxvk

Hardware Specs

  • CPU model: Intel Core i5-12400F
  • GPU model: AMD Radeon RX 6600 (nvidia has this issue too)
  • RAM amount: 64 GB
  • TF2 install location: C:\Steam\steamapps\common\Team Fortress 2
  • TC2 install location: C:\Steam\steamapps\common\Team Fortress 2
  • TC2 installation method: Basic
@vorsh vorsh added bug Something isn't working needs triage Needs to be organized tf2 Related to the TF2 live version and TC2 labels Aug 22, 2023
@vorsh
Copy link
Author

vorsh commented Aug 22, 2023

Probably this allocation is being done each frame, because when i capped my fps at 66 it was allocating much slower.

@vorsh
Copy link
Author

vorsh commented Sep 3, 2023

looks like a memory leak in VGUI, found multiple vgui staticClientDLLToolsPanel strings in memory chunk with leaked memory and a lot of repeated data "F..Ѫ.....øÚ¬..... É..p¶Ö.|.." (hex: 46 09 04 D1 AA 0E 00 00 00 00 F8 DA AC 0E 00 00 00 00 A0 C9 8B 0E 70 B6 D6 0E 7C 07 01) with 1 char difference on each.

@vorsh
Copy link
Author

vorsh commented Nov 10, 2023

Setting r_drawvgui to 0 (requires sv_cheats 1) stops tf2 from leaking its memory, but doesn't clean leaked memory. Something is broken with VGUI on wine

@vorsh
Copy link
Author

vorsh commented Nov 10, 2023

@vorsh
Copy link
Author

vorsh commented Nov 10, 2023

Found a potential leak location https://github.com/mastercomfig/tf2-patches/blob/adce75185fe5822309f356424ea449dee029e2d8/src/engine/vgui_baseui_interface.cpp#L932C23-L932C23

No, the leak remains, or I built the project incorrectly, I don’t know for sure.

I give up, I have no idea where in VGUI this memory leak occurs, and why it only happens inside wine...
I'll leave this thread open, maybe someone else can find the root of the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage Needs to be organized tf2 Related to the TF2 live version and TC2
Projects
None yet
Development

No branches or pull requests

1 participant