MineColonies

MineColonies

53M Downloads

Crash when opening postbox

RyTechro opened this issue · 14 comments

commented

Minecolonies version

Version:
Up to date with branch version/1.14 so 0.10.432??

Expected behavior

The postbox loads smooth and doesn't overflow the open file buffer

Actual behaviour

If you place down a postbox and open it it takes a short while before the inventory fully loads. If you open the postbox a lot of times like 10 times the game crashes.

Steps to reproduce the problem

  1. Create world
  2. Place townhall
  3. Place postbox
  4. Open the postbox 10 times
  5. ... Profit

Crash log

https://gist.github.com/RyTechro/f823fbd7aee2a1a112248ae42b33ba8e

commented
commented
commented

We got a similar issue open to this already so I'll close this here. But we're working on making this more scaleable.

commented

If it's a memory issue something is not cleaned out correctly on closing the ui. The issue also rises when opening the postbox enough times just before it crashes and then opening a different UI

commented
commented

The issue also occurs if the inventory opens are spread over like an hour. Is this consistent with your theorie?

commented
commented
commented

That too many open files warning feels like its to blame for this.

[20:34:35] [Client thread/WARN] [structurize:blockout/]: java.nio.file.FileSystemException: /Users/robindejong/Desktop/ModdedMinecraftDevelopment/minecolonies/build/resources/main/assets/minecolonies/textures/gui/builderhut/builder_button_small.png: Too many open files

Could it be that when rendering all the files for the GUI of the postbox it opens all the icons it needs for the display and afterwards never closes them?

On second thought; its always this builder_button_small.png file. Is that loaded inside a loop that behaves unexpectedly?

commented

After looking into this even more I belief BlockOut is to blame for this crash. Is there a way I can make a test interface with a lot of buttonimages to isolate this issue?

Also you said this issue would be reopend; but it isn't yet

commented

Yes, there are xml files in the mod which have the GUIs you can simply add a lot of buttonimages to one of these xmls and load them. Afaik you should be able to override those gui files with a resource pack as well and add your own interace on top of an existing one.

commented

I checked into it, and debugged it, I opened the GUI many times and the quantity of buttonImages in the memory stayed the same, so I believe it is because we're drawing so many of them and the GC doesn't have time to clean them all up.
So yeah, we have to optimize this GUI in general to only display and render those we need.
The best thing is probably to make it pages and not a scrolling list.

commented

Fix pushed