mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[PR #1164] [MERGED] Fix memory leak in MooncakeBackend destructor #2046
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#2046
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?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/Mooncake/pull/1164
Author: @Copilot
Created: 12/4/2025
Status: ✅ Merged
Merged: 12/4/2025
Merged by: @UNIDY2002
Base:
sunxun/ep-ci← Head:copilot/sub-pr-1099📝 Commits (4)
7870a53Initial pland668c79Add destructor to fix memory leak in MooncakeBackendbba7cf8Final update: Memory leak fix completede7425f4Delete _codeql_detected_source_root📊 Changes
2 files changed (+12 additions, -1 deletions)
View changed files
📝
mooncake-ep/include/mooncake_backend.h(+1 -1)📝
mooncake-ep/src/mooncake_backend.cpp(+11 -0)📄 Description
Description
Addresses memory leak in
MooncakeBackendwheremeta_.activeRankswas allocated but never freed. The allocation occurred vianew bool[](CPU path) orcudaHostAlloc(CUDA path) in the constructor, but the default destructor did not deallocate.Changes:
meta_.activeRanksdelete[]for memory allocated withnewcudaFreeHostfor memory allocated withcudaHostAllocnullptrafter deallocationType of Change
How Has This Been Tested?
Code review and security scan completed with no issues.
Checklist
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.