Botania

Botania

133M Downloads

GunModel Reserves 128MB Heap Space

Brittank88 opened this issue ยท 2 comments

commented

Mod Loader

Fabric

Minecraft Version

1.18.2

Botania version

1.18.2-434

Modloader version

Fabric: Loader 0.14.8 + API 0.57.0+1.18.2

Modpack info

Res Mechanica | WIP (Currently private!)

The latest.log file

https://pastebin.com/tBQFfpEW

Issue description

After analysing a heap dump of my modpack in the Eclipse Memory Analysis tool, I have noticed that GunModel is reserving what seems to be an unnecessarily large amount of heap space:
chart2

Steps to reproduce

  1. Install Botania
  2. Enter a world
  3. Use MAT to generate and analyse a heap dump of the game (may need to edit MAT's memory allocation to be greater than the size of the heap dump in MemoryAnalyzer.ini).
  4. View "Top Consumers"

Other information

No response

commented

I think this is because we hold onto the ModelBakery so we can do on-demand baking at runtime. Not sure of a good way to resolve this other than prebaking everything on startup.

commented

At least adding it as a config option might be good.

Also, adding DashLoader compatibility so that it can cache all the pre-baked stuff for you would help in this regard. DashLoader is pretty good now in that it caches what mods it can and allows the rest to go about their processes normally.