Electrodynamics

Electrodynamics

503k Downloads

AbstractConnectBlock has a memory leak in getShape

jsburger opened this issue ยท 0 comments

commented

I've had a pretty harsh memory leak with Electrodynamics in my modpack and it seems to be caused by wires not properly caching their VoxelShapes. I did a heap dump, and a hashmap in Uninsulated Silver Wire alone was taking up 1.2 GB of memory. Insulated Silver Wire was also an offender (these are the only two wire types in my base so far, about 20 blocks placed total) taking up about .5 GB.
I'm no expert at debugging these sorts of things, but the heap analyzer is pointing to a hashmap by the name of 'shapestates'. Having a look at the code, I think it is caused by using arrays for the hash keys. I don't think java arrays are hashed based on contents, which would mean the hashmap is constantly accumulating new entries.