All entity loaded by server is keep on World entity list.
After some traveling in the map, the world has 30 000 loaded entity and bad tps.
I used two way to get total loaded entity for a world in order to analyse the issue:
First way is a simple call to world.getEntities().size()
The second method count entity chunk by chunk ( using nms ) :
for (Chunk chunk : world.getLoadedChunks()) { for (List<Entity> slice : ((CraftChunk) chunk).getHandle().getEntitySlices()) entities += slice.size(); }
The first call return 41K entities.
This second method return 6K.
In WorldServer the doTick use the world entity list to tick all entity, creating a lot of freeze and lag by ticking all this "ghost" entity.
For 6 online players and 6 of view distance, the serveur use 13GB of ram because of these entities, for same config in 1.13 we use 6GB of ram.
Total world result :
Chunk by chunk result :
called at one second interval with 6 online players