High memory usage
Kenny-Hui opened this issue ยท 6 comments
Expected Behaviour
Memory should be freed when no longer used
Actual Behaviour
After going outside of the station's render distance, memory decreases a little, but marginally increase when returning back.
I am suspecting whether the new dynamic images is the cause (Since they take up an immense memory on its own), and it seems to be less impactful with lower Font Resolution/Places with less MTR Signs.
This is extremely noticeable on larger stations, and could hit over 16GB within 1-2 hours of normal gameplay
Reproduction Steps
MTR Font Resolution: 4
- Travel through a populated station with lots of Signs and PSD
- Travel out of that station (Completely out of the rendering distance)
- Travel back in
Repeat until memory starts increasing.
Crash Report
Out of memory, no crash report.
hs_err_pid1656.log
Note: This is not normal player behavior, I specifically played to replicate that bug with a medium-sized station to avoid impact from other mods.
However it's still possible to run out of memory under normal gameplay, just not at this rate.
Environment
- Minecraft Version: 1.17.1
- Installed Mods:
MTR 3.1.0-unofficial-2
Joban Client Mod 1.1.3 (Rendering Disabled)
Slideshow 1.0
Additional Information
- Allocated Memory: 2GB
- GPU: Intel Graphics HD 630 / NVIDIA GTX 650 Ti BOOST
- Installed Resource Pack:
None / Programmer Art
Issues
- This memory increase isn't very noticeable on Font Resolution lower than 4, but 4 brings similar quality as vanilla font rendering, so it's not unjustified to set a resolution this high
- If the player allocates more memory (e.g. 4-8GB), they could end up with Minecraft eating over 20-40GB of RAM (And Windows automatically allocating a very large pagefiles).
- Minecraft memory usage does not account for this portion (Presumably Dynamic Image are generated on a separate thread?)
F3 Menu and performance profiler like Spark does not seems to indicate the actual memory usage by Dynamic Image
-On some GPU, swapped memory seems to account for Private Bytes, while Windows Task Manager only reports Working Set.
This may cause the end user to not notice the memory increase. (I ended up with a 40GB pagefiles due to this bug, even constantly monitoring Task Manager) - It's just my experience, feel free to correct/add the issues I mentioned
Much better going around the same station, although it still hits around ~5GB more than what I've allocated even in completely vanilla terrain
Not sure if it's just the train textures causing this or dynamic images
@Kenny-Hui does this still persist in the latest builds?
Still somewhat leaks memory, though probably not relevant to the dynamic images
One minor problem is the dynamic images will not remove itself if the chunk is unloaded, though that shouldn't matter as it also clears the dynamic images occasionally
Spark doesn't find anything either, it's something not in Minecraft's thread