Entity Culling

Entity Culling

11M Downloads

Possible excessive ram usage

GodMorduk opened this issue ยท 2 comments

commented

At first, thank you for the great mod. It really helps a lot.

Checking heap dump I found out that 200mb is taken by some cache arrays full of arrays full of int[], where all int are zeroes.

image
image
image

Is that intended? Maybe there is a way to optimize that, as, well, 200 mb of memory is pretty much.

To Reproduce
Steps to reproduce the behavior:

  1. Load into the world, make a heapdump and check it

Versions
Entity Culling: 4.0.0
Forge: 14.23.5.2847
Minecraft: 1.12.2

Other
Crash report (upload as a file): none
Latest log (upload as a file): I don't think it is relevant, provide if necessary
Singleplayer/Multiplayer: singleplayer
Other mods (that are necessary to produce the bug): I don't think it is relevant, provide if necessary
Other mods (that are also installed): I don't think it is relevant, provide if necessary

commented

I don't know what tool you use. But...
The raytracing cache has a radius of 256 blocks.
That means it's size is 512x512x512 = 134,217,728 blocks.
But I only need 2 bits per block.
134,217,728 / 8 * 2 = 33,554,432 bytes = 33.55 MB
So I don't know how it could require 200 MB.
Though I can probably lower the cache range and maybe also make it configurable.

commented

Yeah, looks like i misread the profiles results, my bad. Whole Entity Culling stuff seems to take 35 461 223 bytes which is quite similar to your calculations. But make cache range configurable and maybe ability to turn it off in config would be nice though. Thank you for the reply.