mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #834] [Bug]: mooncake_master potential memory leaking #253
Labels
No labels
ascend
auto-closed
bug
bug
CI/Build
Common
documentation
enhancement
feature request
good first issue
help wanted
high priority
MetaX
nightly-failure
pull-request
PyTorch Backend
question
RFC
Roadmap
stale
Store
Tests
Transfer Engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/Mooncake#253
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @nickyc975 on GitHub (Sep 12, 2025).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/834
Originally assigned to: @xiaguan on GitHub.
Bug Report
We observed that mooncake_master's memory usage keeps growing up when running stress_cluster_benchmark.py in prefill mode multiple times. Here is a simple script to demonstrate our operations:
Running the test against the latest version of Mooncake produced the following result:
As we can see, mooncake_master's memory usage keeps growing dramatically in the first 4 tests, and finally reaches as high as 39.9g. The problem is that, the memory usage may increase after the first test, but should not increase to that much in following tests.
Before submitting...
@ykwd commented on GitHub (Sep 12, 2025):
Thanks for reporting this. We will try to find out what happened.
@xiaguan commented on GitHub (Sep 15, 2025):
Thanks for reporting this.
Quick summary: This is not a memory leak, but expected behavior.
The stress test generates too many small keys, which are frequently inserted into the
std::unordered_map. Even though we callerase()later, theunordered_mapdoesn't immediately shrink or release memory.As a workaround, try increasing the value size during testing. We might also look into more efficient index structures in the future.
@xiaguan commented on GitHub (Sep 15, 2025):
reproduce
result
@xiaguan commented on GitHub (Sep 17, 2025):
close this issue since it's not a bug.