每次切换维度或返回主菜单时,游戏都会将旧世界留在身后,Java 本应释放它。如果任何模组仍然持有对该世界的引用(例如静态字段、以世界为键的缓存),整个世界就会一直保留在内存中:包括其区块、实体,以及在单人游戏中整个已停止运行的服务器及其配方、战利品表和进度。经过几次维度切换或几次世界重载后,内存就会耗尽。
Dimension Leak Fix 会清理游戏已放弃的内容,使得任何仍持有该世界引用的对象只持有一个空壳,并促使那些已知存在泄漏问题的模组释放对它的引用。
功能说明
- 切换维度或返回主菜单: 3 秒后,旧世界的区块槽位将被释放,它拥有的地图和列表(包括其他模组添加到其中的列表)将被清空。一旦连接关闭,客户端的副本配方和旧玩家的配方书也会被清空。
- 退出单人世界: 集成服务器停止后,其区块表、实体和数据包内容(配方、函数、战利品表、进度、结构模板)将被清空,并且它在游戏共享标准中留下的进度追踪器将被注销。
- 已知存在泄漏问题的模组: Liberty Villagers、Serene Seasons、Fabric API fake players、Jade 和 Flywheel 会释放你离开的这个世界或服务器。每个问题模组都是通过在真实整合包的堆转储(heap dump)中发现的。如果某个模组未安装,则会被跳过。
- 低内存模式: 如果在清理等待期间内存使用率超过 90%,清理操作将立即执行。
- 诊断信息: 日志会显示你离开的世界或服务器是否真正从内存中释放,或者如果 5 分钟后它仍然存在,则表明有另一个模组仍在持有它。
只会处理属于你离开的那个世界或服务器的内容。当前世界中仍在使用的容器永远不会被清空。
日志输出
实际输出,NeoForge 1.21.4:一次前往下界,然后返回主菜单并再次进入世界的过程。
[DimensionLeakFix] World change detected, old world will be released in 3s
[DimensionLeakFix] Phase B complete (710 references released)
[DimensionLeakFix] Return to menu detected, old world will be released in 3s
[DimensionLeakFix] Singleplayer server stopped: 0 advancement tracker(s) unregistered, 0 known leak reference(s) released, 10675 entries emptied in 3 world(s) and its datapack contents
[DimensionLeakFix] Old world freed from memory (71s after leaving it)
[DimensionLeakFix] Singleplayer server freed from memory (18s after leaving it)
兼容性
- Fabric: Minecraft 1.18.2 至 26.3
- Forge: Minecraft 1.18.2 至 26.2
- NeoForge: Minecraft 1.20.2 至 26.3。在 1.20.1 上,请使用 Forge 版本的文件:它也可以在 NeoForge 上运行。
- 请在客户端安装。专用服务器不需要它;如果整合包无论如何都在服务器上打包了它,它会在服务器上加载但不会执行任何操作。
- 无需配置。
已在 Legends Reborn: Medieval 整合包中使用。
Every time you change dimension or go back to the menu, the game leaves the old world behind and Java is supposed to free it. If any mod still holds a reference to that world (a static field, a cache keyed by world), the whole world stays in RAM: its chunks, its entities and, in singleplayer, the whole stopped server with its recipes, loot tables and advancements. A few dimension changes or a few world reloads later, memory is full.
Dimension Leak Fix empties what the game has abandoned, so whatever still holds it only holds an empty shell, and makes known leaky mods let go of it.
What it does
- Dimension change or return to menu: 3 seconds later, the old world's chunk slots are released and the maps and lists it owns are emptied, including the ones other mods add to it. Once its connection is closed, the client copy of the recipes and the old player's recipe book are emptied too.
- Leaving a singleplayer world: once the integrated server has stopped, its chunk tables, entities and datapack contents (recipes, functions, loot tables, advancements, structure templates) are emptied, and the advancement trackers it left in the game's shared criteria are unregistered.
- Known leaky mods: Liberty Villagers, Serene Seasons, Fabric API fake players, Jade and Flywheel let go of the world or server you left. Each one was found in a heap dump of a real modpack. A mod that is not installed is skipped.
- Low memory: if memory use goes over 90% while a cleanup is waiting, it runs right away.
- Diagnostic: the log says when a world or server you left is really freed from memory, or that it is still there 5 minutes later, which points at another mod holding it.
Only what belongs to the world or server you left is touched. A container still used by the world you are in is never emptied.
Log output
Real output, NeoForge 1.21.4: a trip to the Nether, then back to the menu and into the world again.
[DimensionLeakFix] World change detected, old world will be released in 3s
[DimensionLeakFix] Phase B complete (710 references released)
[DimensionLeakFix] Return to menu detected, old world will be released in 3s
[DimensionLeakFix] Singleplayer server stopped: 0 advancement tracker(s) unregistered, 0 known leak reference(s) released, 10675 entries emptied in 3 world(s) and its datapack contents
[DimensionLeakFix] Old world freed from memory (71s after leaving it)
[DimensionLeakFix] Singleplayer server freed from memory (18s after leaving it)
Compatibility
- Fabric: Minecraft 1.18.2 to 26.3
- Forge: Minecraft 1.18.2 to 26.2
- NeoForge: Minecraft 1.20.2 to 26.3. On 1.20.1, use the Forge file: it runs on NeoForge too.
- Install it on the client. A dedicated server does not need it; if a modpack ships it on the server anyway, it loads there and does nothing.
- No configuration.
Used in the Legends Reborn: Medieval modpack.
下载 Dimension Leak Fix
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Dimension Leak Fix
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Dimension Leak Fix
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Dimension Leak Fix
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Dimension Leak Fix
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Dimension Leak Fix
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Dimension Leak Fix
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Dimension Leak Fix
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Dimension Leak Fix
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Dimension Leak Fix
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
v1.0.4:
- 当其他模组的更新移动了 Dimension Leak Fix 清理的内容时,日志现在会显示一行说明其名称。此前,该清理操作会被跳过且没有任何提示。
v1.0.3:
- 首次发布 Forge 和 NeoForge 版本。代码与修复内容与 Fabric 版的 Dimension Leak Fix 1.0.3 相同。
- 当你切换维度或返回主菜单时,你离开的世界会在 3 秒后被清空,因此任何仍持有该世界的模组仅会持有一个空壳。退出单人世界也会清理已停止的集成服务器。
- 释放来自其他模组的已知内存泄漏(Serene Seasons、Jade、Flywheel),仅涉及对你所离开的世界或服务器的引用。
- 日志会显示你所离开世界或服务器是否真正从内存中释放,或者在 5 分钟后是否仍然存在。
- 仅在客户端安装即可。服务器不需要此模组;即使整合包将其包含在服务器端,它也会在服务器上加载但不会执行任何操作。
- 在 Minecraft 1.20.1 中,同一文件可同时适用于 Forge 和 NeoForge。
- 无配置文件。
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
评论 0
登录后参与评分
还没有评论,来抢沙发吧