Search Issue Tracker
By Design
Votes
2
Found in
2018.4
2019.4.7f1
2020.2
Issue ID
1272020
Regression
No
[iOS] UnityWebRequest POST request does not close and results in memory leak
How to reproduce:
1. Open the attached 'SamplePostRequestBR.zip' project
2. Build for iOS and open the Xcode project
3. Deploy Xcode project to iOS device
4. Press 'Start Requests' button
5. Inspect memory growth in Debug navigator
Expected result: Memory increases and causes memory leak
Actual result: Memory remains the same
Reproducible with: 2018.4.26f1, 2019.4.9f1, 2020.1.3f1, 2020.2.0a21
Reproducible with:
iPhone 8+ (iOS 12.0)
iPhone XR (iOS 13.4.1)
iPad 9.7 6th gen (iOS 12.1)
iPad Air 2 (iOS 13)
iPhone 7 (iOS 13)
iPhone 5s (iOS 12)
Notes:
- Most of the times it happens in the first attempt, but if after 10 minutes you don't see the memory growing, stop everything, clean the Unity project (remove Xcode project and Library folder) and start over, this shouldn't take more than a couple of attempts
- Screenshots of the issue are attached in Edit
Comments (2)
-
Ruslank100
Aug 22, 2020 11:08
There should be a way to report these bots
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
Resolution Note (2020.2.X):
Only a superficial investigation was done, please reopen in case the issue can be reproduced after fixing the notes below:
- After a quick search in code I don't see UnityWebRequest objects being disposed nor placed inside using block. This means that the project relies on Garbage Collector entirely, which would explain the intermittence of the issue. Given that majority of memory used by UWR is native memory, the GC might not kick in (since it's still plenty of free managed memory).
- A repro project uses awaiters and async tasks, overcomplicating the things. Could a simple project that uses UWR in coroutines and proper disposes be made? If so, check the memory consumption in it, reopen if a leak still can be observed.