Memory leak #1072
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot#1072
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hookshot version
v2.0.7
What kind of problem
Crash, freeze or black screen
What happened
Built the game with v2.0.1 or v2.0.2, i'm not sure I remember, and I was having the psychedelic glitch on screen with 1fps, then turned the resolution to 50% and it fixed the glitch, but not the 1fps. The Title screen and video plays at 60fps, but as soon as you get in-game it's back to 1fps.
I then updated to v2.0.5, same. v2.0.7, same. I then decided to rebuild the game using v2.0.7, because all the other versions I was using the already-built folder. The game launches, and the colours are oversaturated, the video plays, and then post video the game stays at a blackscreen, and memory fast fills my 32GB RAM limit, causing the watchdog to kill it.
I've tried extracting the AppImage to run the bin/hookshot, and it's the same.
Where in the game
Post title screen video
How often
Every time
Graphics card and driver version
RX 5700XT, latest mesa
CPU, RAM and operating system
AMD 5700X3D, 32GB DDR4 3200, Fedora 44 GNOME 50
Changes from the defaults
No response
Other software hooked into the game
Hooked MangoHud, tried without, same.
hookshot_log.txt
hookshot_log.txt
Screenshots or video
No response
Before you send it
Thanks for the report. The RX 5700 XT has no mesh shaders, so it runs on the fallback path; linking this to that tracker #1001 (and the Linux tracker #1000). The RAM filling up after the title video on the v2.0.7 rebuild is the key detail.
The RAM filling up I had it before too (v2.0.3) but updating to v2.0.5 (without rebuilding) stopped it. Playing on v2.0.7 without rebuilding also didn't fill up ram, only after rebuilding with v2.0.7 I saw the ram filling up again.
Iris Xe on Linux (Mesa ANV), v2.0.7: the first mesh draw takes a SIGSEGV inside
libvulkan_intel.so, and RSS climbs 5.7 -> 26 GB at that same frame.Same shape as the report above (video plays, then black and RAM to the limit), on a different vendor and driver. Gen12.2 has no
VK_EXT_mesh_shadereither, so it is the fallback path.It is a small draw (2 task workgroups), so it does not look like a size problem. I also found that
--prepare-shadersleaks on its own with no game, no window and nothing drawn: flat at 4.0 GB for 14 minutes, then 4.0 -> 18.7 GB in 6 minutes while@@progressstayed at 0.028.Full report, with per-second memory samples and both backtraces, is in #1001: #1001
RX_VK_PRECOMPILE=0gets past the preparation leak and gives a window and a full intro movie; it does not get past the crash at the first mesh draw.v2.0.8rc3 increased the framerate to ~7fps, with the same memory leak.
I don't believe the memory leak is just with this fallback because I have a 6700xt and it still fills my ram before the opening cutscene finishes.
Is there a point testing this on a GPU without mesh shaders? or emulation is the peak for those GPUs?
+1 from #1331 (closed into this): RX 5700, Mesa 26.2.5, Omarchy (Arch, Hyprland), v2.0.11: 8-10 fps from the first gameplay frame, and RAM grows to 32 of 40 GB.
Another data point, on NVIDIA. Unlike the AMD reports, fps is fine at first, but memory still keeps growing until the game freezes.
Setup: v2.0.11 native Linux AppImage build. Arch (Omarchy, Hyprland). RTX 5080 16 GB, NVIDIA 615.78.08. Kernel 7.2.15. 32 GB RAM.
What happens:
(The peak numbers are from systemd's accounting of the game's scope.)
The game's own log counters stay roughly flat while RAM grows, so the growth seems to be somewhere the log doesn't report:
Device-heap VRAM was near its budget at the end (11.7 of 12.5 GB used). Right before the freeze, the log shows
a capture's wait for write-back ... timed outa few times.I can share the full game.log if it helps.
This memory leak is still happening on the latest version 2.0.13.
happens also on 2.1.0
The latest release fixes my memory leak, the oversaturation, and the low fps.
can you share your hookshot_options.ini still overcomsuming ram for me
A 44-minute run on NVIDIA at 4K: no growth like the RTX 5080 report above, on current main. RTX 4090, NVIDIA 615.78.08, i9-13900K, 93 GB RAM, Arch Linux; main
bdfe09cbuilt from source; headless (no window), Output resolution 3840x2160, Render resolution 100%, 60 FPS cap.Kokiri Forest from a save, with a camera turn every 9 s for 2,770 s (164,827 frames, 60 fps). The game's memory was sampled every 10 s from /proc and nvidia-smi:
So on this driver and current main, staying in one area doesn't fill RAM the way @zeeboguy saw on v2.0.11 (18-18.7 GB and swapping after 34-74 minutes). At this rate it would grow about 0.2 GB in 74 minutes.
I haven't tested v2.0.11 itself, other areas, a windowed or fullscreen run (the swapchain and the scaling to the screen are left out headless), longer than 44 minutes, or AMD.
I retested in the latest version 2.1, and still is consuming over 14GBs, with my 32GB it consumed almost all ram, leaving 2GB on max left.
Would be great if this port got some optimization, 14GB is too much for a game.
I don't know if this is still considered a memory leak, but the ram consumption is great.
What the ~14 GB are and what changes them, measured on Linux with an NVIDIA card. RTX 4090, NVIDIA 615.78.08, i9-13900K, 93 GB RAM, Arch Linux; main
bdfe09cbuilt from source (41 commits after v2.1.0), headless, 60 FPS cap, Kokiri Forest from a save with a camera turn every 9 s. Memory is read from /proc and nvidia-smi. These are memory counts, not frame rates: other jobs ran on the machine (load average 121 falling to 41 during the default run, 5 to 16 during the others).At the default settings (Output resolution 2048x1152, Render resolution Auto), 220 s after the start:
(They add up to 13,941 MB; the other 413 MB look like the NVIDIA driver's mappings counted twice.)
vk: malloc: 5914 MB in arenas (5703 MB in use, 210 MB free). Resident memory stayed between 14,271 and 14,418 MB from 60 s to the end, and in the 44-minute run above it grew 26 MB per 10 minutes.What changes it, with the same save:
RX_VK_LOW_SPEC=1(the Minimum (4GB) preset)RX_VK_PRECOMPILE=0, a developer switch)For the maintainers: the README's "A run uses about 10 GB" matches the run without the preparation; with it I see 14,354 MB. That run built 962 pipelines in 140 s, of the 16,574 the preparation makes ready. As I read
gpu/vk, the shader modules are needed again only when a new pipeline is built, and on this prepared folder play built 3 in 220 s. Whether the driver gives the modules' 2,197 MB back when they're destroyed, I haven't measured.Not tested: Windows, AMD, the v2.1.0 release build itself, other areas, a window or fullscreen, Profile Handheld, the presets on a card their caps apply to, frame times, sessions longer than the 44 minutes above.
Memory leaks in 2.1.0
ryzen 5-5600
3060 ti
16gb ddr4
linux mint
Logs:
hookshot_log.1.txt
hookshot_log.txt
Thanks for the report. Reports of the same problem are now collected in #993, which lists this one with your details and links back here, so one fix closes them together and the open list stays readable. Follow #993 for the fix, and add new details there (or here). If this turns out to be a separate problem it will be reopened.