Mobs remain in memory
Memory clean up for mobs and entities does not seem to occur.
Steps to reproduce
name tag a mob (or spawn a unique mob of any type). execute the following command
- /tp @s ~+1000 ~ ~+1000
- Wait for several minutes or hours at that location.
- run the following command:
/execute @e [name="nametagedname"] ~~~ say hi
Expected result
You get a red message saying "No targets matched selector"
Actual result
Jim says "hi."
The root issue is that over time CPU and RAM usage creep up over time causing large amounts of lag on busy servers. Right now this causes a forced reboot of the BDS software frequently to empty the memory.
This may be reduced with mob despawning however it still is a memory leak that causes things to go way up over time. In small quantities it is not a problem, however with a world spawning thousands of blocks and has many players, this becomes a major issue.
- Unresolved
MadHatter
- 37
- 9
- Confirmed
- 364059
- Multiple
- BDS, Realm, Windows 10
- mobs optimization
Created Issue:
Mobs remain in memory
Memory clean up for mobs and entities does not seem to occur.
Steps to reproduce.
name tag a mob (or spawn a unique mob of any type). execute the following command
/tp @s ~+1000 ~ ~+1000
Wait for several minutes or hours at that location.run the following command
/execute @e [name="nametagedname"] ~~~ say hi
The root issue is that over time CPU and RAM usage creep up over time causing large amounts of lag on busy servers. Right now this causes a forced reboot of the BDS software frequently to empty the memory.
This may be reduced with mob despawning however it still is a memory leak that causes things to go way up over time. In small quantities it is not a problem, however with a world spawning thousands of blocks and has many players, this becomes a major issue.
- Unresolved
- Open
- Unconfirmed
- Multiple
- BDS, Realm, Windows 10
- 1.14.60 Hotfix
Memory clean up for mobs and entities does not seem to occur.
Steps to reproduce.
name tag a mob (or spawn a unique mob of any type). execute the following command
/tp @s ~+1000 ~ ~+1000
Wait for several minutes or hours at that location.run the following command
/execute @e [name="nametagedname"] ~~~ say hi
The root issue is that over time CPU and RAM usage creep up over time causing large amounts of lag on busy servers. Right now this causes a forced reboot of the BDS software frequently to empty the memory.
This may be reduced with mob despawning however it still is a memory leak that causes things to go way up over time. In small quantities it is not a problem, however with a world spawning thousands of blocks and has many players, this becomes a major issue.
Memory clean up for mobs and entities does not seem to occur.
h4. Steps to reproduce.
name tag a mob (or spawn a unique mob of any type). execute the following command
- /tp @s ~+1000 ~ ~+1000
- Wait for several minutes or hours at that location.
- run the following command
- /execute @e [name="nametagedname"] ~~~ say hi
Expected result
You get a red message saying "No targets matched selector"
Actual result
Jim says "hi."
The root issue is that over time CPU and RAM usage creep up over time causing large amounts of lag on busy servers. Right now this causes a forced reboot of the BDS software frequently to empty the memory.
This may be reduced with mob despawning however it still is a memory leak that causes things to go way up over time. In small quantities it is not a problem, however with a world spawning thousands of blocks and has many players, this becomes a major issue.
Memory clean up for mobs and entities does not seem to occur.
h4. Steps to reproduce.
name tag a mob (or spawn a unique mob of any type). execute the following command
- /tp @s ~+1000 ~ ~+1000
- Wait for several minutes or hours at that location.
- run the following command
- /execute @e [name="nametagedname"] ~~~ say hi
Expected result
You get a red message saying "No targets matched selector"
Actual result
Jim says "hi."
The root issue is that over time CPU and RAM usage creep up over time causing large amounts of lag on busy servers. Right now this causes a forced reboot of the BDS software frequently to empty the memory.
This may be reduced with mob despawning however it still is a memory leak that causes things to go way up over time. In small quantities it is not a problem, however with a world spawning thousands of blocks and has many players, this becomes a major issue.
Memory clean up for mobs and entities does not seem to occur.
Steps to reproduce
name tag a mob (or spawn a unique mob of any type). execute the following command
- /tp @s ~+1000 ~ ~+1000
- Wait for several minutes or hours at that location.
- run the following command
- /execute @e [name="nametagedname"] ~~~ say hi
Expected result
You get a red message saying "No targets matched selector"
Actual result
Jim says "hi."
The root issue is that over time CPU and RAM usage creep up over time causing large amounts of lag on busy servers. Right now this causes a forced reboot of the BDS software frequently to empty the memory.
This may be reduced with mob despawning however it still is a memory leak that causes things to go way up over time. In small quantities it is not a problem, however with a world spawning thousands of blocks and has many players, this becomes a major issue.
Memory clean up for mobs and entities does not seem to occur.
Steps to reproduce
name tag a mob (or spawn a unique mob of any type). execute the following command
- /tp @s ~+1000 ~ ~+1000
- Wait for several minutes or hours at that location.
- run the following command
/execute @e [name="nametagedname"] ~~~ say hiExpected result
You get a red message saying "No targets matched selector"
Actual result
Jim says "hi."
The root issue is that over time CPU and RAM usage creep up over time causing large amounts of lag on busy servers. Right now this causes a forced reboot of the BDS software frequently to empty the memory.
This may be reduced with mob despawning however it still is a memory leak that causes things to go way up over time. In small quantities it is not a problem, however with a world spawning thousands of blocks and has many players, this becomes a major issue.
Memory clean up for mobs and entities does not seem to occur.
Steps to reproduce
name tag a mob (or spawn a unique mob of any type). execute the following command
- /tp @s ~+1000 ~ ~+1000
- Wait for several minutes or hours at that location.
- run the following command:
/execute @e [name="nametagedname"] ~~~ say hi
Expected result
You get a red message saying "No targets matched selector"
Actual result
Jim says "hi."
The root issue is that over time CPU and RAM usage creep up over time causing large amounts of lag on busy servers. Right now this causes a forced reboot of the BDS software frequently to empty the memory.
This may be reduced with mob despawning however it still is a memory leak that causes things to go way up over time. In small quantities it is not a problem, however with a world spawning thousands of blocks and has many players, this becomes a major issue.
relates to
relates to
relates to
relates to
relates to
Thanks Jonathan Hanzel, I think MCPE-77266 should cover that issue based on the comment you left there.
The issue is entities. See MCPE-77266 for new entity related memory leaks
Made final comment edit, will try to reduce spam emails in the future
In Sheri's world the mobs are able to be tp'd probably because they only get removed from memory if everyone changes dimensions or leaves the world. As long as you have loaded them once and at least one player has continually been in present in the same dimension they never get removed from memory. That behavior is tracked as a bug in its own right at MCPE-77266.
Is your server created before update 1.19.20? Perhaps your problem is described in the MCPE-160818 and MCPE-77266. We also track problems only with unmodified worlds (if this is a problem in the Amulet).
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 BDS Wiki – 📖 FAQs
After a player left the game while holding a filled map, the chunks within a 17x17 chunk radius of the player's location are not unloaded. This issue can be observed when executing the command "/testfor @e" as entities within that specific area are still detectable.
After decompiling the code, I discovered that the issue stems from the fact that the MapItemSavedData retains the MapItemTrackedActor representing the player, and this representation is never removed, even after the player left the game. Additionally, within this context, the MapItemTrackedActor also holds a reference to the ChunkViewSource. This ChunkViewSource maintains a GridArea<shared_ptr<LevelChunk>> of a size of 17x17 chunks, contributing to reference counts that prevent the proper destruction of LevelChunk objects.
Steps to Reproduce:
(In BDS)
- Start a BDS.
- Join the server.
- Leave the game.
- Execute "/testfor @e" in console.
- Join the server again.
- Hold a filled map.
- Leave the game.
- Execute "/testfor @e" in console.
(Locally)
- Start a multiplayer game.
- Have the host execute the command, standing in the Overworld at coordinates (0, 0), playing the role of the BDS as mentioned in the previous context.
- Have a second player join the game, standing in the Overworld at coordinates (1000, 1000) (ensuring no overlap with the host's position), playing the role of the player mentioned earlier.
- Perform the same sequence of actions as described earlier, with the only difference being that the host executes the commands instead of the console. You should observe the same results as with the BDS scenario.
Observed Results:
The first "/testfor @e" command shows "No targets matched selector" while the second one has entities.
Expected Results:
The expected outcome is that neither of the "/testfor @e" commands should have any targets, in both cases.
Notes:
This issue is triggered whenever a player takes out a filled map during a game session. Please ensure that no one has this item in their inventory before proceeding with the first step.
This bug is distinct from MCPE-77266. In MCPE-77266, entities can unload correctly after a player exits, and only entities near the player's joined area fail to unload before the player exits.
Have you tried this without holding a map? It sounds like MCPE-77266--entities and chunks are never unloaded until the entire dimension is unloaded.
If you are sure this is a different issue from MCPE-77266, then please update your Steps to Reproduce to clarify how many players are needed and in what dimensions and coordinates they should be and what order they should join and exit the world, to demonstrate the bug.
The easy way is to put a command block on repeat every 300 or so ticks, and run the command "spreadplayers 0 0 5000 5001 @a" on repeat. the more players you have in the world the faster the bug will repro.
Server resets clear the issue, but it builds up quickly on servers.
Happens on BDS, on Realms, and local
It makes sense for mobs to be kept in memory for a period of time after chunks are out of simulation distance because then they won't need to be re-loaded if the player soon moves back to where it had been. Also, in some cases it is beneficial, such as if you have a sprawling village it is better to keep all villagers loaded so that some are not dropped from the dwellers list, which can cause problems like stolen POI and infinite breeding. However, I would not have expected that the mobs are never cleared out memory until relog/reset. I would expect that a combination of distance and time since last memory access could be used to unload mobs (and chunks) to optimize performance.
I don't know if this is the same, but I discovered a memory leak with entities in 1.16.20, where if you kill an entity it remains in memory (e.g. I use /kill @e to kill 300 entities, the 300 entities are still in memory, causing over 60% of my RAM being used) until the world is reloaded.
Good find, I sincerely hope this gets addressed, the lag is unbearable in this update
GoldenHelmet can you link this report with
MCPE-99760?Affects 1.16.100.60, more noticeable on computers with smaller amounts of RAM (less then 4GB)
Affects 1.16.200.51
Please verify if this occurs in 1.16.100
Affects 1.16.210.50
Affects 1.16.201
Affects 1.16.230.54
Affects 1.17.0.50
In singleplayer, most mobs are removed from memory when you change dimensions, but mobs within roughly 7 chunks of the player spawn point are not (see
MCPE-134908). However, I am not sure if this works in multiplayer.Affects 1.17.40.20
Affects 1.18.20.25
Affects 1.18.30
Affects 1.19.0.34 and 1.19.0.35
Affects 1.20.80
Affects 1.21.10.20
Note to mods: Since the original reporter has been inactive for over two years, I wish to take ownership of this report so I can update affected versions and continue maintaining this report.
Affects 1.21.20.21
Affects 1.21.2
Affects 1.21.20.23
Affects 1.21.30.22
Affects 1.21.30.24
This appears to be fixed in 1.21.40.20
Fixed in 1.21.51