Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GC lag in EntityAIMilking.checkGrass #44

Open
LemADEC opened this issue Oct 27, 2019 · 1 comment
Open

GC lag in EntityAIMilking.checkGrass #44

LemADEC opened this issue Oct 27, 2019 · 1 comment

Comments

@LemADEC
Copy link

LemADEC commented Oct 27, 2019

As of 1.12.1-Harderfarming-7.0.0a, we can see lots of memory allocation in the debug menu.
Using VisualVM, we can see lots of BlockPos objects created every seconds:
image

From a quick check in the related source code, here: https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/farming/entities/ai/EntityAIMilking.java#L78

We can see a volume scan allocating BlockPos objects at every position.
Consider using a MutableBlockPos to reduce the GC load.
I didn't profile for Vec3d objects, but there's probably someway to recycle them here too.

@Draco18s
Copy link
Owner

Thanks for the input. I'm busy working on getting things on 1.14 and I think I'm going to completely overhaul how I'm dealing with animals as it is. There were a lot of factors that made the system wacky and overall unfun.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants