Search Issue Tracker
Fixed in 5.3.7
Destroying Texture2D doesn't free memory
Steps to reproduce:
1. Open attached project "765799.zip"
2. Open scene "repro"
3. Open "TestMemoryLeak.cs"
4. Notice that it creates new Texture2D every second. Then destroys it.
5. Run scene
6. Open task manager and notice how memory builds up
Note: This issue is only partially visible in the profiler: "Used Total" doesn't increase when memory builds up, only "Total System Memory Usage" builds up.
Reproduced with: 5.1.4f1, 5.2.4p1, 5.3.2p1, 5.4.0b4
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- Filters dropdown: Window doesn't rescale on items collapse
- Sprite Preview is broken when the Sprite is too tall or too wide
- Objects are invisible in Scene view when using Wireframe Shading Mode
- The property of a component becomes read-only when it is bound to "PropertyStreamHandle"
- Physics.Raycast does not work when used on the whole model
Aug 18, 2020 04:46
good one <a href="https://www.lyricsauto.com">lyricsauto</a>
Apr 13, 2020 07:16
I intentionally destroyed Texture2D to get rid of low storage errors which were popping up again and again. One should click http://www.toptenwritingservices.com/essaysoft-net-review/ for help in essays. But I was so surprised to see results because of this action as they were no good.
Jul 02, 2019 22:29
It seems this can be still reproduced with 2019.1.8f1.
When inspected with Memory Profiler, tens of old allocations could be found from memory, and if continued would eventually kill player or editor on any platform.
And a call to Resources.UnloadUnusedAssets() still fixes this.
May 14, 2019 06:39
For another workaround, save your window layout (top right drop down). https://happywheels2.io When this happen, choose your saved layout and it will be visible again.
Sep 06, 2017 15:29
"For my case, calling that helped: Resources.UnloadUnusedAssets();"
Also worked for me thanks XLUNCHBOXXX. I was just converting screen grabs to JPGs using textures. They never were release it seemed until I called the above.
Jun 28, 2016 17:06
For my case, calling that helped: Resources.UnloadUnusedAssets();
Jun 16, 2016 14:27
I should mention that I am on 5.3.4f1 - and the device I am testing on is presently iOS. The leaks I am seeing are around 70MB for 4 textures being created and explicitly destroyed.
Jun 16, 2016 14:26
I am running into this exact situation, but cannot reproduce the leak in Editor. When running on device, however, I can see the Mono heap grow on each iteration, even though the number of textures and amount of texture memory reported in the profiler remains consistent.
May 19, 2016 13:01
Same issue is faced while internet connection lost while downloading videos. Both in Android & iOS