Chisels & Bits - For Fabric

Chisels & Bits - For Fabric

2M Downloads

RAM usage

Shizz0 opened this issue ยท 7 comments

commented

Hello,
over time the ram usage increased more and more until we had to allocate 16G on the clients.
I know that worldedit and this mod can escalate really quickly, but there's something
i like to ask/mention.

  1. There are ten thousands of c&b blocks in range of a single player (spawn area).
  2. Those c&b blocks are mostly the same (~200-300 different ones), but copied.

So my question is, why does the ram usage increase if i copy/place the same kind of c&b block?
Sure, i don't know how the rendering works, but would it be possible to kind of share the memory between c&b blocks that are made of the same bits, or does it work already like this?
Here's one building for example: https://i.imgur.com/FKP7UX5.png

commented

C&B already merge, the model for each block, each face in the model, and the voxel data is de-duplicated in ram. However if C&B is the cause of your issue I can only imagine that the issue lies in the final rendering model size. Since that cannot be de-duplicated.

Each chunk must have its set of vertex data at the last minute, and breaking that up would destroy preference by increasing render call count by a large volume.

I'm quite shocked by the 16GB number, even the most complicated map I've looked at in the past used less then 1GB without any other mods / texture packs. ( its scary how fast mods and textures and pile up when you start adding things )

You can try disabling enableModelCompression and see if it uses more or less ram, in my experience it improved things significantly, but sometimes these things vary.

Beyond what I've explained, I can only offer to look at the save if you can get me a copy, I might be able to use it to find further ways to reduce ram usage, Several of the optimizations in C&B were only possible because of maps given to me by other ambitious users. I can't promise anything obviously beyond looking at it to see what might be improved.

commented

Hello,
thanks for the answer!
So i tested/noted a few things:

  1. upgrading from c&b version 14.11 to 14.13 changes nothing with default config
  2. 14.13 with B:enableModelCompression=false seems to reduce the used ram by 1-2GB, still ~8-10GB in use hehe
  3. it is ONE building that seems to EAT ~8GB. Just type "/warp asien" for it.
  4. we managed to reduce the ram usage at spawn (/spawn) but still about 5-8GB depending where you are.
  5. As reference, the mod pack itself uses ~2-3GB in areas without c&b

Here's everything you need to run the map (150MB)
https://www.dropbox.com/s/dkd7tqxatnz1mtt/Client.zip?dl=0

I hope the map serves as good research object xD

commented

Thanks I'll try to take a look over the weekend.

commented

Wow this really helped alot ๐Ÿ‘
It halved the ram usage! I tested it on my end and now i need to wait for the guy that has acess to the server. I have ftp acess but no console... weird but that's another story...

Thanks!

commented

I do believe that there are quite a few more unique blocks then you imagine, possibly due to placing off the block grid, rotations, or some other reason. I think that my heap dumps recorded around ~4k unique blocks.

So that means there are about 4k models, and fairly complicated models at that, at least by minecraft standards.

That being said there might be some good news, This is certainly the most memory heavy map I've encountered by a fair bit, it shows that in general, the compression system I was using doesn't work that well in the large scale with more models.

So I've worked out a new one, though it probably uses more CPU cycles, on the plus side those CPU cycles are spent in the multi-threaded part of the renderer.

I would suggest you give it a try, and let me know how it works out for you, I saw C&B's polygon memory footprint drop from around 2.4GB to 900MB and it removes the existing framework that was in use for compression.

All in all my tests show that memory usage of the new build is around one third what it used to be on the map.

https://www.dropbox.com/s/ekdb8vnmf560oc5/chiselsandbits-14.13.jar?dl=0

commented

@AlgorithmX2 Just a bystander, but thanks a lot for your ambitious, selfless work on this project. It really makes Minecraft a whole new experience. I appreciate your attention to detail on matters like this!

commented

Thanks for the map and testing, this should be in the next release.