Skip to content

Fix memory leak bug #534

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Fix memory leak bug #534

wants to merge 11 commits into from

Conversation

Binyang2014
Copy link
Contributor

Fix #533

@liangyuRain
Copy link

Also, I wonder if the MR registered in IB should also be properly unregistered in RegisteredMemory's destructor?

const IbMr* mr = contextImpl.getIbContext(ibTransport)->registerMr(data, size);

@Binyang2014
Copy link
Contributor Author

Also, I wonder if the MR registered in IB should also be properly unregistered in RegisteredMemory's destructor?

const IbMr* mr = contextImpl.getIbContext(ibTransport)->registerMr(data, size);

For MR and QP, thinking if we could wrap it into shared_ptr.

WARN("Attempted to remove a memory that is not registered or already removed: %u", memoryId);
return;
}
memories_[memoryId] = RegisteredMemory();
Copy link
Contributor

@chhwang chhwang Jun 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a resource lock so that the removal doesn't happen while there exists unflushed triggers on the flight in the proxy. Also, we need a mechanism that prevents proxies on remote ranks from processing requests on this RegisteredMemory.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think users are responsible for safely releasing the buffer. Before removing it, ensure that no peers or device-side operations are still accessing this memory. Adding spinlock here to prevent race conditions inside the proxy_channel.

@Binyang2014 Binyang2014 marked this pull request as ready for review June 13, 2025 02:36
@Binyang2014
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@Binyang2014
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] RegisteredMemory not properly destroyed
3 participants