Question by
GoFightFantastic · Nov 24, 2019 at 06:57 PM ·
arraymemory managementmemory usagegarbagememory leaks
Clear Color32[] array from memory?
If I create a massive Color32[] array like the one below, it'll reserve about a gig of memory (showing up as Mono: 1 GB) in profiler:
Color32[] c32 = new Color32[16384 * 16384];
I can't however find a way to destroy, clear or nullify the array to get the memory to go back below 1 GB usage. I've tried to change the length of the array, set it to null, clear it, destroy the script and the object, force a GC.Collect() and force a Resources.UnloadUnusedAssets() and loading a new scene... Am I missing something? How do dispose of the array and recover the used memory?
Comment
Your answer
Follow this Question
Related Questions
Run out of memory in build 1 Answer
OPEN WORLD GAME QUESTION 2 Answers
Does empty array declaration take memory? 1 Answer
Memory error pls help 0 Answers