
Item Conduits Overloading Server
UOAlien opened this issue ยท 12 comments
I'm running a Galactic Science modpack server using EnderCore 0.2.0.31 Beta and EnderIO 2.3.0.422. When at least one player is present, everything seems to run fine. Once the last person logs out, the server starts to build items (from what I can tell) to the point of crashing completely running out of memory (at 4GB).
I performed a heap dump when I noticed it starting to become unresponsive and analyzed it with Eclipse Memory Analyzer and it shows there are 568,577 objects of 'crazypants.enderio.conduit.TileConduitBundle' using a total of 68,229,240 heap size and 887,689,792 retained heap size.
The number of objects is over 11 times that of the next item in the list (which appears to be Evolved Zombie at 49,882 objects!?)
To my knowledge, there are no chunk loaders active and the setup of Ender IO conduits is rather small (less than 50 conduits/energy put together).
Is there a bug or is something happening on the server that I could alleviate these issues?
if you can slap onto your server and your client chickenchunks chunkloader(probably removing the recipes for the chunkloaders as they are causing some trouble), you can type /chunkloaders on the client to get a scrollable map of loaded chunks and scan your bases for chunkloading acitity ... that way i discovered that twilight forest has an severe chunkloading issue with it's tree of time! ...
your conduits are doing absolutely fine @tterrag1098 our bases did not chunkload since the redstone conduit patch anymore
Something is likely spamming unloading/reloading chunks which causes lots of memory churn. It could be EnderIO (we have had some issues [fixed ones] like that in the past) but without any investigation it's impossible to say. The crazy high count of zombies is likely also a side-effect. I don't recommend using the mod generally, but ChickenChunks has a great command /chunkloaders
which can show you loaded chunks. You can use this (while not near the buggy area) to see if something is in fact forcing the chunk to constantly unload.
Are those objects alive or are they dead and being GCed? Looking for chunks loading and unloading will only help with the later one.
If they are alive, then some mod is keeping them alive. Which is a big nono in Minecraft. The base game is the only one who is allowed to keep (tile)entity objects alive (by keeping a chunk in memory).
There have been instances of mods remembering every single entity forever, keeping their objects alive that way. That may be happening here, too. (Ender IO isn't doing that.)
@HenryLoenwind I am not sure how to tell. This is my first forray into looking at this kind of info (heap dumps, etc)
As for loaded chunks; I downloaded and installed ChunkLoaders, loaded up the GUI using /chunkloaders and moved away from the base. The base remained loaded with chunks coming and going in the area.
If I log out and back in, the base remains loaded (the chunks appear to be popping in and out).
This happens for a few minutes and then they unload completely. If I move back in range, the chunks again start loading/unloading for a few minutes.
I have no idea what could be causing the loading of the chunks; we have nothing that we know of intentionally loading them. Do any of the EnderIO machines do this? Or am I beating up the wrong tree?
(I have 1 full speed Farming Station running jungle/oak trees and carrots. The farm is entirely in 2 chunks, but the trees could branch out of those chunks, around 30 Stirling Generators, couple of SAG and Alloy Smelters and 5 Vibrant Capacitors)
There is no easy way to see what is causing the chunks to orphan. Your best bet is removing blocks until the problem no longer occurs. The last thing you remove before it's fixed is the culprit, obviously.
uuuhhh i remember this one on our server, you (very sure) have an broken chunk, some bundled conduit is bugging out as hell, you need to trace down the chunk slowly by approaching the lagging area and then you should edit all conduits from this area with MCEdit
breaking it was not sufficient as there was still an invisible inreplacable block there
you can also dismantle you cables one by one and replace them. once you found the bugging one you can then edit it out
We've noticed this on our server to. The only way we've solved it (beside completely replacing every single conduit), is by placing an admin anchor on top of personal anchors already in place. It seems when any sort of anchors are uses the adjacent chunks who have connected conduits want to load and unload constantly. Thus producing much more response time and in the case of chunks that spawn mobs or have entities on them, duplicate them indefinitely.
On another note, this was happening int he spectre dimension as well. Single chunk, all contained, yet was still producing the same results as an overworld or other dimension issue stated above.
falcnor, that's to be expected when placing a multi-block partly into a chunkloaded chunk and partly outside it.
However, what we see here might not just be chunks being loaded and unloaded all the time, but some mod keeping the old objects from unloaded chunks in memory. Otherwise the GC would be able to reclaim those objects and the game would lag, but not run out of memory.
@HenryLoenwind i should have mentioned our server was maxing out the memory also ... could you think of any logic state of a bundled cable beeing imported from a broken datafile resulting in a loop of objects, chewing up the memory? PS AE2/RV2 was present but not used in the broken bundle
Yes, it is possible that a single block takes up an unlimited amount of memory.
However, most blocks are coded in a way that their memory consumption is fix---they don't have some list in them that can grow. So it is unusual to have a single block "leak" memory. You can see the difference easily in a memory dump. If there are few objects but a large memory consumption, one of them is leaking. If there are very many objects, then something else is amiss.
Minecraft stores blocks as two parts. The first one is the actual block. That is stored in a structure that has a fixed size. The second part is only present in blocks that have more than 16 states---this includes all blocks that have an inventory, or can handle power or fluids. And that part is an actual Java object, the so-called "Tile Entity". It should only live as long as a chunk is loaded, because the chunk object is keeping it alive. Once the chunk object dies (after the chunk is unloaded), all objects it kept alive will die, too. And as with all dead bodies, they will lie around until someone removes them. With Java that "someone" is called Garbage Collector ("GC").
So, ignoring other sources of memory usage, there are a couple of scenarios:
- There are too many chunks loaded, filling up the memory. => Out Of Memory error.
- There are many dead objects around, filling up the memory. => Garbage Collector has to run to reclaim the memory.
- Some Tile Entity is using too much memory. => Out Of Memory error.
- Something is keeping Tile Entities alive that should have died with their chunk. => Out Of Memory error.
With what I read in the original report, I tend toward blaming the 4th one. What you, mindforger, are suspecting would be the 3rd one. What tterrag is trying to help with would be the 2nd one. (BTW: The first two ones are quite normal and happen all the time. In moderation.)
However, without some tricky memory profiling in the jvm (which btw cannot be done from within Minecraft), I cannot say for sure. I'd need to probe what references those 568,577 conduit bundles. The answer would be one of:
- Nothing: They will be collected by the GC as memory fills up. Most likely caused by chunks being loaded and unloaded very often.
- A chunk: Too many chunks loaded. Quite unlikely here, unless someone really placed over half a million conduits on the server.
- Someone else: Who? That'd be the culprit.
Thank you everyone for the replies! I would say there's something wrong elsewhere in the pack as it crashed quite often once we started using various other mod items and finally crashed the entire server computer to the point of a restart and corrupt world. We've moved on to another pack with the same Ender IO version and it is running as expected.
@HenryLoenwind in a memory dump
i feel sooo stupid right now ...
i used java mission control but the only thing i was noticing is never ending GC and pileup of memory trash which i could not resolve with mission control to any mod or entity
i should've dumped the memory to analyze it, maybe i could've found the culprit then