Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Memory leak 内存泄露 #2493

Open
HongchengQ opened this issue Mar 31, 2024 · 4 comments
Open

[Bug] Memory leak 内存泄露 #2493

HongchengQ opened this issue Mar 31, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@HongchengQ
Copy link

Each player occupies a significant amount of memory in this program. This is a server that has been running for 10 hours. Prior to this, the online player count remained between 10 and 30. When players exit the game, the server does not clean up the corresponding memory, resulting in excessive memory usage even when there are only two players left on the server. This is even crazier than GIO.

每一名玩家在这个程序上占用的内存都非常多 这是一个开了10个小时的服务端 在这之前在线人数保持在10-30之间 当人们退出游戏时服务端并不会清理掉对应的内存 使得即使最后服务端只有两名玩家 内存占用也非常离谱 这简直比gio还要疯狂

屏幕截图 2024-03-31 202752

@HongchengQ HongchengQ added the bug Something isn't working label Mar 31, 2024
@HongchengQ
Copy link
Author

我使用vvm观察发现内存占用会随着玩家的进入而越来越多 似乎总有一部分内存不会被清理 但这不是gc崩溃最主要的原因 每次gc崩溃都会发生线程死锁 在线程死锁之前程序占用的内存会达到历史最高点 然后cpu占用几乎会占用到百分百 最后发生线程死锁 玩家进入游戏白屏

@HongchengQ
Copy link
Author

I observed using vvm that memory usage increases as more players enter the game, and it seems that a portion of the memory is not being cleaned up. However, this isn't the primary cause of GC crashes. Before each GC crash, there's a thread deadlock, which occurs after the program reaches its highest historical memory usage point. This is followed by near 100% CPU usage, leading to a thread deadlock. Players then experience a white screen when entering the game.

@HongchengQ
Copy link
Author

以及在程序启动后第一个玩家进入游戏时也有概率发生线程死锁
这在还没有合并unstable分支前是不会发生的
Additionally, there's a chance of a thread deadlock happening when the first player enters the game after the program starts.
This did not occur before the unstable branch was merged.

@HongchengQ
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant