Skip to content

内存流失潜在问题 #509

@cgw2023

Description

@cgw2023

你想加入什么功能?

在调查 LuminolMC/Luminol#156 的时候我发现luminol也有使用 https://github.com/Winds-Studio/Leaf/blob/ver/1.21.7/leaf-server/minecraft-patches/features/0174-Smart-sort-entities-in-NearestLivingEntitySensor.patchhttps://github.com/Winds-Studio/Leaf/blob/ver/1.21.7/leaf-server/src/main/java/org/dreeam/leaf/util/FastBitRadixSort.java

是来自Leaf,而 Leaf 的FastBitRadixSort 则是我在Jprofiler 发现有问题的部份,所以我直接来leaf这边回报。

我服务器存在大量怪物生怪塔,特别是猪人塔,一秒会有上百猪人死亡,服务器开半天就会发现old gc 启动,heapdump结果显示下图

Image

Entity[] 佔用了18GB

GPT 顯示,Entity 数组从来不会缩小,刚好我这服务器怪物超多,服务器开长时间,问题会更加严重。

if (this.entityBuffer.length < size) {
    this.entityBuffer = new Entity[size];
    this.bitsBuffer = new long[size];
}

bug回报我没办法使用所以才用建议,请检查代码问题确认是不是有这个问题,谢谢

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: more info neededWaiting response and provide more informationunsupported versionThis Minecraft version is no longer being supported/maintained

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions