mojira.dev
MC-39827

Too many mobs in a small area cause RAM crash

When too many mobs are put in a confined area, and that chunk is loaded (the player logs in, or enters the area otherwise), the server suddenly starts using all the memory available on the server, and eventually goes to swap, then java closes minecraft with a memory exception. Specifically, one of our players had more than 400 cows in a 1x1 box. Another player had hundreds of sheep in 2x2 fenced yards. It seems to be more of a problem with cows and sheep than chickens. As soon as these redstone "factory farms" were removed, the chunks can load, and server is back at regular RAM usage (around 3GB).

What I Expected to Happen:
I expect Minecraft server to use a reasonable amount of RAM, and that the RAM used would not suddenly increase to the point where the server crashed.

What Happened:
One of our players put 400+ cows in a little box and they were glitching so hard trying to find a path that their AI code grabbed all the RAM on the box and forced java to end the process.

How to Reproduce:
Stuff about 400 cows in a 1x1 box (they must be bred and be forced in by water)..... OR...... breed about 500 sheep in a 2x2 fenced area.

Linked issues

Comments 8

edited the java version in env. on first try, reported the version from my workstation accidentally, sorry.

What version of java do you have installed?

java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.14) (rhel-1.65.1.11.14.el6_4-x86_64)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

Same issue as MC-39816. OpenJDK has been known to cause issues with Minecraft. Please update to either OpenJDK 1.7 or Oracle java 1.7.

this is a basic, generally unmodified CentOS dedicated server. more details are:
Dell T110 Xeon E3-1220v2 3.1GHz 4 Cores
Hard Drive: Dell 1TB 7.2K RPM SATA 3Gbps
CentOS 6.3 - 64 Bit
16GB RAM
1GB network uplink
hosted in Arizona, USA at Codero

I have run public servers with 1.6.2, 1.6.4 on this same machine (vanilla at first, then bukkit), same Java, no crashes. I have some players that I know built giant spawners on those servers, running on this machine, and we've never had this problem.

When I visited the player's base who was crashing our server, the cows were just glitching like crazy in a 1x1 box. As soon as I "cleared" the mobs with some splash harming, server RAM returned to normal. Like immediately.

At the moment, I've asked my players to keep the mobs in "free range" enclosures - with a limited number and room to find a path to walk - to ensure the health and safety of the server and all it's inhabitants. All players are now able to use the server, and it has not crashed since.

If you need anything else, please let me know.

Oh, the server address is minecraft1-7.com

Ok, thanks. I'll update and test.

Ok, tested with OpenJDK 1.7.0 - and it works! thank you so much!!

Good to know that fixed it! Will comment on the other report.

Sam Corl

(Unassigned)

Unconfirmed

Minecraft 1.7.2

Retrieved