Copyright © 2026 Unity Technologies
Thank you for reporting a bug to Unity. After reviewing the behavior, we've confirmed that it is a known limitation of the WebGL GC implementation and not a bug with UnityWebRequest. We encourage you to see - https://issuetracker.unity3d.com/issues/garbage-collector-memory-leak-when-allocating-and-deallocating-memory-in-web-builds for more details. We suggest couple of work around - 1. Use the exposed nativeData to access the downloaded bytes directly bypassing allocation that needs to be cleaned up by the GC. 2. Use a smaller chunk to read in the data. This will drastically reduce the probability of GC falsely pinning the memory as in use. E,g - a 100mb allocation in 250mb wasm has a 40% chance of being not cleaned up by GC, where a 64kb allocation in 250mb wasm has a 0.025% chance of not cleaned up by GC. 3. Preallocated the big buffer knowing it may be not released, and re-use it for the duration of the application lifetime. We will close this case as 'As Designed.' If you have feedback on how the feature could better meet your needs, please let us know - we value your input and consider it in future improvements.
How to reproduce:
Actual result: “Total Used Memory” graph goes up when pressed “L” but does not lower on success message - “Total Resident On Device” only increases
Expected result: “Total Used Memory” graph goes up when pressed “L” and lowers when a success message shows up - “Total Resident On Device” fluctuates but is around the starting amount
Reproducible with: 6000.0.0f1, 6000.0.76f1, 6000.3.16f1, 6000.4.9f1, 6000.5.0b10, 6000.6.0a6
Reproducible on: Windows 11
Not reproducible on: No other environments tested
Issues you vote on will appear here