Skip to content

Memory leak when machines running (Client only) #4571

@Xefyr0

Description

@Xefyr0

Checked for existing issues

  • I have checked for existing issues, and have found none.

Tested latest version

  • I have checked that this occurs on the latest version.

GregTech CEu Version

v7.4.1

Minecraft Version

1.20.1 Forge

Recipe Viewer Installed

None

Environment

Multiplayer - Dedicated Server

Cross-Mod Interaction

No

Other Installed Mods

N/a - this bug is entirely base GT.

Expected Behavior

Expected to be able to run large quantities of machines for extended periods without crashing.

Actual Behavior

After leaving several (24) LV singleblocks running while supplied by creative sources, the game crashed with an OutOfMemoryError.

Image

Steps to Reproduce

  1. This issue only manifests on a client connected to a dedicated server. After installing Forge 47.4.12 and GregTech 7.4.1 on your server and client, add -XX:MaxDirectMemorySize=128m to your Java args. This is technically optional, but drastically reduces the maximum allocation to the type of memory that's leaking which allows you to get positive results (crashes) faster.
  2. Create a new world or load into an existing one.
  3. Build a large array of machines that will be operating constantly, supplied with Creative Energy, Creative Tanks, and Creative Chests. I recommend covering it with a roof or disabling doWeatherCycle so that the machines don't explode in the rain and halt your progress. I used four lines of 6 machines each constantly producing and voiding Silicon from Cobblestone for 24 machines in total, but it may be helpful to build more so the effect is more pronounced - the rate of memory leakage is related to machine activity.
Image
  1. AFK. The machines will continue to produce while you are away, slowly leaking memory into the Direct Buffers. When the space runs out you will crash, producing a message akin to the screenshot in the "Actual Behavior" section. It should take you a few hours with my setup which is why I recommend you build more machines.

Optional: Install Embeddium and Oculus to get an extra entry in the F3 menu that displays the size of your Direct Buffers. This allows you to track the effect and severity of the leak more precisely while in-game.

Image

Additional Information

This issue has been corroborated by several reports from players in the Monifactory Discord, but I have personally confirmed that the leak is present when no other mods or scripts are involved using the methods described in this report.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions