I'm tracking down the elusive dimension-changing memory leak in 1.7.10. One potential leak I've found is that PrefixBlock contains an mRenderParameterTileEntity variable, but it doesn't appear that this variable is cleared when the client world changes. This means that a block could potentially hold on to that client world until it is rendered again in another world.
I see two ways of fixing this: use a WeakReference to hold the tile entity (which will allow the world to be garbage collected), or loop through all PrefixBlock instances when the player changes dimensions and reset this field to null.
GC root diagram on an otherwise-unused WorldClient instance from VisualVM:
I'm tracking down the elusive dimension-changing memory leak in 1.7.10. One potential leak I've found is that PrefixBlock contains an
mRenderParameterTileEntity
variable, but it doesn't appear that this variable is cleared when the client world changes. This means that a block could potentially hold on to that client world until it is rendered again in another world.I see two ways of fixing this: use a
WeakReference
to hold the tile entity (which will allow the world to be garbage collected), or loop through allPrefixBlock
instances when the player changes dimensions and reset this field to null.GC root diagram on an otherwise-unused
WorldClient
instance from VisualVM: