Double Slabs

Double Slabs

5M Downloads

Slabs Maxes out Memory

SushiCrazy101 opened this issue ยท 7 comments

commented

I have 16gb of ram with 8gb for minecraft. I have found that when using worldedit and stacking it maxes out memory to 100% and continuously lag spikes. Is there any chance of reducing the ram usage?

commented

I got problems with high RAM-Usage too, it fills up slowly, like a memory leak or something. Also unsing Optifine.
Happens on both versions 1.16.3 and 1.16.4 on different Servers

commented

I have the same problem when using slabs ram raises from 2~Gb to 4Gb used.I also use optifine.

commented

I have the same issue. Memory starts at 61%, fills up by 1% every second, freezes shortly when it reaches 78%, then goes back to 61% and then it repeats. I had this problem before using Optifine and while using it. I don't think that installed or allocated RAM is related at all because I used this mod a while back for 1.15 with 2gb RAM allocated and did not experience this. This also seems to occur even if slabs haven't been stacked/placed yet in a save file, and I notice that the title screen has lag spikes as well.

commented

Hi there! I believe that this should be fixed in the latest version.. For now it is only for 1.16 but I will be backporting to older versions as soon as I can :) Thanks again for your patience.

commented

Thanks for your patience, I've just released a new beta version of the mod for 1.16 which attempts to address this performance issue. If anyone is willing to test that this does indeed improve performance (from my testing I had ~100 vertical slabs which used ~2GB of RAM on 3.4.10. On 3.4.5rc1, this went down to ~600MB - 1GB). If this fix does indeed improve performance, I will then backport the change to previous versions. Sorry for the delay and inconvenience.

commented

The problem is that every slab tile entity contains two instances of cjminecraft.doubleslabs.api.BlockInfo which is instantiating new ServerWorldWrapper or WorldWrapper objects which inherit from ServerWorld and World respectively. This is, among other things, triggering a cascade of events as other mods attach their capabilities to the new world objects. Slabs should at least be sharing world instances instead of instantiating new ones and, ideally, new world objects should not be instantiated at all.

commented

Hi, thanks for the response. You are entirely correct that is the source of the performance issues. The main issue I was trying to address was tricking the slabs to think that they are the only block in that space so that for example slabs with tile entities have less issues and get the expected tile entity and state when they use the getTileEntity and getBlockState method from World. I was looking into how I could implement this and saw the Forge Multipart mod which implemented World Wrappers so I went to try and use those. Whilst they achieved everything I needed them to, they also cause a significant performance increase with large numbers of slabs. For 1.12 this is worse as more things are called when instantiating a world wrapper.

The new update (rc1) reverts back to an older system which does not use WorldWrappers and as such performance should be improved. I plan on pushing this update back to previous versions but inevitably reverting back to an old system may cause compatibility issues, hence the release candidate and only updating for 1.16.

If the new version does indeed improve performance for you, please let me know and of course if there are any issues, keep me posted.
Thanks again :)