solsticegamestudios / GModCEFCodecFix

🛠 Automatic Patching/Updating of GMod CEF. Also fixes macOS/Linux launch issues. And missing main menu issues.
GNU General Public License v3.0
446 stars 21 forks source link

Add some sort of memory cap to avoid gmod using all RAM #91

Closed Growebis closed 11 months ago

Growebis commented 11 months ago

Perhaps this is a me issue or perhaps its a GMOD 64bit issue, but i have 12GBs of ram, yet Garry's Mod slowly eats it all up, eventually freezing the entire system. What happens is that Garry's Mod at first uses little ram, then when i enter into a map, ram usage spikes and Garry's mod starts using over 5GBs of ram, and when i change the map, ram usage increases. This continues until GMOD freezes my system and it's too late unless i have earlyoom running. I have tried to change the heapsize amount yet nothing changes.

I propose that the CEFFix should limit its ram consumption or ask the user how much ram would they like Garry's mod to use. Although again, i'm not sure if it's a me issue or if it can even be fixable.

System info in case its useful.


System:
  Kernel: 5.15.0-89-generic x86_64 bits: 64 compiler: gcc v: 11.4.0 Desktop: Cinnamon 5.8.4
    tk: GTK 3.24.33 wm: muffin dm: LightDM Distro: Linux Mint 21.2 Victoria base: Ubuntu 22.04 jammy
Machine:
  Type: Laptop System: Dell product: G3 3500 v: N/A serial: <superuser required> Chassis: type: 10
    serial: <superuser required>
  Mobo: Dell model: 0HN4GN v: A02 serial: <superuser required> UEFI: Dell v: 1.24.0
    date: 03/14/2023
Battery:
  ID-1: BAT0 charge: 38.5 Wh (100.0%) condition: 38.5/51.0 Wh (75.4%) volts: 12.8 min: 11.4
    model: SMP DELL PN1VN0C serial: <filter> status: Full
CPU:
  Info: quad core model: Intel Core i5-10300H bits: 64 type: MT MCP arch: Comet Lake rev: 2 cache:
    L1: 256 KiB L2: 1024 KiB L3: 8 MiB
  Speed (MHz): avg: 2884 high: 3007 min/max: 800/4500 cores: 1: 3007 2: 2913 3: 2947 4: 2904
    5: 2922 6: 2776 7: 2806 8: 2799 bogomips: 39999
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
  Device-1: Intel CometLake-H GT2 [UHD Graphics] vendor: Dell driver: i915 v: kernel ports:
    active: eDP-1 empty: DP-1, DP-2, HDMI-A-1, HDMI-A-2 bus-ID: 00:02.0 chip-ID: 8086:9bc4
  Device-2: NVIDIA TU117M [GeForce GTX 1650 Ti Mobile] vendor: Dell driver: nvidia v: 535.129.03
    pcie: speed: 8 GT/s lanes: 8 ports: active: none empty: HDMI-A-3 bus-ID: 01:00.0
    chip-ID: 10de:1f95
  Device-3: Sunplus Innovation Integrated_Webcam_HD type: USB driver: uvcvideo bus-ID: 1-5:4
    chip-ID: 1bcf:2b99
  Display: x11 server: X.Org v: 1.21.1.4 driver: X: loaded: modesetting,nvidia
    unloaded: fbdev,nouveau,vesa gpu: i915 display-ID: :0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 102
  Monitor-1: eDP-1-1 mapped: eDP-1 model: AU Optronics res: 1920x1080 dpi: 142
    diag: 394mm (15.5")
  OpenGL: renderer: NVIDIA GeForce GTX 1650 Ti/PCIe/SSE2 v: 4.6.0 NVIDIA 535.129.03
    direct render: Yes
Audio:
  Device-1: Intel Comet Lake PCH cAVS vendor: Dell driver: sof-audio-pci-intel-cnl bus-ID: 00:1f.3
    chip-ID: 8086:06c8
  Device-2: NVIDIA vendor: Dell driver: snd_hda_intel v: kernel pcie: speed: 8 GT/s lanes: 8
    bus-ID: 01:00.1 chip-ID: 10de:10fa
  Sound Server-1: ALSA v: k5.15.0-89-generic running: yes
  Sound Server-2: PulseAudio v: 15.99.1 running: yes
  Sound Server-3: PipeWire v: 0.3.48 running: yes
Network:
  Device-1: Intel Comet Lake PCH CNVi WiFi driver: iwlwifi v: kernel bus-ID: 00:14.3
    chip-ID: 8086:06f0
  IF: wlp0s20f3 state: up mac: <filter>
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Dell driver: r8169
    v: kernel pcie: speed: 2.5 GT/s lanes: 1 port: 3000 bus-ID: 04:00.0 chip-ID: 10ec:8168
  IF: enp4s0 state: down mac: <filter>
Bluetooth:
  Device-1: Intel AX201 Bluetooth type: USB driver: btusb v: 0.8 bus-ID: 1-14:5 chip-ID: 8087:0026
  Report: hciconfig ID: hci0 rfk-id: 0 state: down bt-service: enabled,running rfk-block:
    hardware: no software: yes address: <filter>
Drives:
  Local Storage: total: 1.43 TiB used: 374.52 GiB (25.5%)
  ID-1: /dev/nvme0n1 vendor: Toshiba model: KBG40ZNS256G NVMe KIOXIA 256GB size: 238.47 GiB
    speed: 31.6 Gb/s lanes: 4 serial: <filter> temp: 47.9 C
  ID-2: /dev/sda vendor: Western Digital model: WD Blue SA510 2.5 1000GB size: 931.51 GiB
    speed: 6.0 Gb/s serial: <filter>
  ID-3: /dev/sdb type: USB vendor: Western Digital model: WD USB Hard drive size: 298.09 GiB
    serial: <filter>
Partition:
  ID-1: / size: 386.12 GiB used: 250.72 GiB (64.9%) fs: ext4 dev: /dev/sda4
  ID-2: /boot/efi size: 146 MiB used: 103.8 MiB (71.1%) fs: vfat dev: /dev/nvme0n1p1
Swap:
  ID-1: swap-1 type: file size: 2 GiB used: 227.5 MiB (11.1%) priority: -2 file: /swapfile
USB:
  Hub-1: 1-0:1 info: Hi-speed hub with single TT ports: 16 rev: 2.0 speed: 480 Mb/s
    chip-ID: 1d6b:0002
  Device-1: 1-1:2 info: Logitech G203 LIGHTSYNC Gaming Mouse type: Mouse,HID
    driver: hid-generic,usbhid rev: 2.0 speed: 12 Mb/s chip-ID: 046d:c092
  Device-2: 1-2:3 info: Sunplus Innovation SPIF30x Serial-ATA bridge type: Mass Storage
    driver: usb-storage rev: 2.0 speed: 480 Mb/s chip-ID: 1bcf:0c31
  Device-3: 1-5:4 info: Sunplus Innovation Integrated_Webcam_HD type: Video driver: uvcvideo
    rev: 2.0 speed: 480 Mb/s chip-ID: 1bcf:2b99
  Device-4: 1-14:5 info: Intel AX201 Bluetooth type: Bluetooth driver: btusb rev: 2.0
    speed: 12 Mb/s chip-ID: 8087:0026
  Hub-2: 2-0:1 info: Super-speed hub ports: 8 rev: 3.1 speed: 10 Gb/s chip-ID: 1d6b:0003
Sensors:
  System Temperatures: cpu: 73.0 C pch: 63.0 C mobo: N/A gpu: nvidia temp: 60 C
  Fan Speeds (RPM): N/A
Repos:
  Packages: 2845 note: see --pkg apt: 2810 flatpak: 35
  No active apt repos in: /etc/apt/sources.list
  Active apt repos in: /etc/apt/sources.list.d/atareao-telegram-jammy.list
    1: deb [signed-by=/etc/apt/keyrings/atareao-telegram-jammy.gpg] https: //ppa.launchpadcontent.net/atareao/telegram/ubuntu jammy main
  Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list
    1: deb https: //mirrors.nxtgen.com/linuxmint-mirror/packages victoria main upstream import backport
    2: deb https: //mirrors.isu.net.sa/apt-mirror jammy main restricted universe multiverse
    3: deb https: //mirrors.isu.net.sa/apt-mirror jammy-updates main restricted universe multiverse
    4: deb https: //mirrors.isu.net.sa/apt-mirror jammy-backports main restricted universe multiverse
    5: deb http: //security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
  Active apt repos in: /etc/apt/sources.list.d/virtualbox.list
    1: deb [arch=amd64 signed-by=/usr/share/keyrings/virtualbox.gpg] https: //download.virtualbox.org/virtualbox/debian jammy contrib
  Active apt repos in: /etc/apt/sources.list.d/winehq-jammy.sources
    1: deb [arch=amd64 i386] https: //dl.winehq.org/wine-builds/ubuntu jammy main
Info:
  Processes: 397 Uptime: 13h 3m Memory: 11.47 GiB used: 5.41 GiB (47.1%) Init: systemd v: 249
  runlevel: 5 Compilers: gcc: 11.4.0 alt: 11/12 Client: Unknown python3.10 client inxi: 3.3.13
]`
FlorianLeChat commented 11 months ago

I think this suggestion is beyond the scope of this tool. If your game has a memory leak, it's probably due to one of your addons or, if not, an issue in Garry's Mod which needs to be reported.

Growebis commented 11 months ago

Alright thanks for the comment.

AkikoKumagara commented 11 months ago

Try and figure out if it's GMod or CEF eating up your memory.

In any case, what's happening to you isn't normal, but also most likely isn't anything to do with our patches.

Florian answered authoritatively, but isn't involved with this project in any capacity, so don't let them discourage you. The scope of this project has evolved so much over time that we have internally considered changing the name to be more all-encompassing.

That being said, their other words are valid, and this is most likely being caused by an addon or GMod bug. You'll need to experiment a bit to narrow it down. See if it happens with all addons disabled, or try enabling some and disabling some others to see if behavior changes.

Growebis commented 11 months ago

I think i'm not the only one with this issue but i will try your proposed solutions. https://github.com/Facepunch/garrysmod-issues/issues/4085 https://github.com/Facepunch/garrysmod-issues/issues/4513 https://github.com/Facepunch/garrysmod-issues/issues/3792

AkikoKumagara commented 11 months ago

I appreciate you fixing the verbiage in your comment @FlorianLeChat :)

FlorianLeChat commented 11 months ago

Yup, my message was a (bit) rude by mistake because my english vocabulary is pretty weak, sorry guys that really wasn't my plan..

Growebis commented 10 months ago

That being said, their other words are valid, and this is most likely being caused by an addon or GMod bug. You'll need to experiment a bit to narrow it down. See if it happens with all addons disabled, or try enabling some and disabling some others to see if behavior changes.

From what i can gather, the issue seems to be a garry's mod bug that becomes worse when you start adding a crap ton of addons.

Yup, my message was a (bit) rude by mistake because my english vocabulary is pretty weak, sorry guys that really wasn't my plan..

No problem.