-
Notifications
You must be signed in to change notification settings - Fork 133
Memory leak in RefreshAsync while using a CancellationToken? #50
Comments
Hi, I had a quick look at the code and couldn't immediately spot a different code path based on the cancellation token being set (actually, the code never really checks for Did you run both tests in Debug or Release mode? Do you have an indication of how much memory you see being leaked? |
The increase is very slow but look here:
The Screenshots are both in DEBUG. But i run in Release an got the same Values. I take two memory snapshots (while the memory use increases) and it looks like this: And it looks like the "SocketExtensions"-Class could be the Problem. I think the
Could btw. also a problem in AdbClient.cs row 296. But never test it^^ |
Great catch, thanks! That does indeed seem to be the problem - I'm trying to find a Roslyn analyzer that catches these kind of exceptions, so I can add them to the project and make sure these kinds of issues don't come up again. It seems that I'll keep you posted! |
Hi, I've prepared a PR - #52, and an updated NuGet release, Can you have a look and let me know if this resolves the issue? Thanks! |
Ah, my bad! I've pushed Thanks! |
Perfekt :) Thx for this |
Hi,
it is me or is RefreshAsync creates a memory leak if using with a CancellationToken? If i use it like the sample (CancellationToken.None) it workes like a charm. But if i pass through the CancellationToken into the function the memory use increase (faster on fast responed devices like Emulators(Nox,Bluestacks) and slowly on normal devices). My Test-Function:
The text was updated successfully, but these errors were encountered: