-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
QuicConnection.ConnectAsync() connection failure causes memory leak. #113030
Comments
Tagging subscribers to this area: @dotnet/ncl |
And QuicConnection.ConnectAsync() cannot be used on Android either. #111019. Although these are two separate issues, I am only concerned about the progress and in which future version they might be fixed... |
VS shows this At the same time, looking at the Can you open an issue at microsoft/msquic repo? |
You'll notice that this function allocates memory from a pool (i.e., lookaside list): DATAPATH_RX_IO_BLOCK*
CxPlatSocketAllocRxIoBlock(
_In_ CXPLAT_SOCKET_PROC* SocketProc
)
{
CXPLAT_DATAPATH_PARTITION* DatapathProc = SocketProc->DatapathProc;
DATAPATH_RX_IO_BLOCK* IoBlock;
CXPLAT_POOL* OwningPool;
if (SocketProc->Parent->UseRio) {
OwningPool = &DatapathProc->RioRecvPool;
} else {
OwningPool = &DatapathProc->RecvDatagramPool.Base;
}
IoBlock = CxPlatPoolAlloc(OwningPool);
if (IoBlock != NULL) {
IoBlock->Route.State = RouteResolved;
IoBlock->OwningPool = OwningPool;
IoBlock->ReferenceCount = 0;
IoBlock->SocketProc = SocketProc;
}
return IoBlock;
} You'll be getting this from a global, per-processor pool In otherwords, this is by design. |
I will also say, that in more recent versions of msquic.dll, we've added support for |
I get that there is a pool, but the private bytes of the process grew from some 30 MB to close to 1 GB, which seems a bit excessive to me. Is there an upper limit on the pool? the two heap snapshots I took show difference of 8000+ live instances allocated from that location. |
What I mean to say, is that even with a pool, the app would reach a steady-state where the private bytes do not increase anymore (modulo noise), but the memory on the repro application keeps on growing. That makes me suspect that maybe the instances are not returned to the pool correctly, or there is some other bug at play. |
Description
In an automatic reconnection use case, the following code is executed in a timer. If the connection fails, it may cause a memory leak, possibly due to underlying handles not being released.
Reproduction Steps
Expected behavior
Normal memory.
Actual behavior
The memory will continue to grow without any signs of being reclaimed.
Regression?
No response
Known Workarounds
No response
Configuration
dotnet 9.0 win-x64 AOT publish
Other information
No response
The text was updated successfully, but these errors were encountered: