Hello,
I’ve been tasked with improving memory usage and it seems that Addressable Asset System is the best for the purpose. I came up with a simple Android app to get familiar with Addressable and to see how it effects memory. Inside the app, I will load a sequence of assets (sprite atlases, sizes vary from 1MB to 16MB) and then release them (in reversed order). There are 11 loads and 11 releases. At each load/release, I check Android Studio’s Memory Profiler and record memory usage into a spreadsheet for comparison.
What I naively expected to see in Memory Profiler
- When an atlas is loaded, the memory would increase the exact amount as the atlas size
- When an atlas is released, the memory would decrease the same amount
The first thing I noted in Memory Profiler was that Graphics memory was the only that varied during loading/releasing which made perfect sense (Java and Code memory did vary but in a random way, so I think they can be ignored)
I have tested with 8 devices and the results are interesting
- Group 1 (Oppo, Vsmart, Samsung, Huawei, LG): the memory changes seem intuitively, it increase with load, and decrease with release. But the amount of increase/decrease is not always the same as the size of the atlas being loaded/released
- Group 2 (Xiaomi Note 5, Xiaomi Note 7 and Google Pixel 4XL): memory increases to its peak after a few loads, and remain unchanged for subsequent loads/release
(You can see this in the attached file)
And this held true for all devices: memory after releasing all atlases is bigger than the memory at start (no atlas loaded), it’s about 32M more (total atlases are 70MB)
So here are the questions :
- Does Addressable not work in Group 2, since memory never gets released ?
- Why is memory after all atlases released even bigger than when start ?
- Why does memory behave so differently between those groups ?
Any help would be appreciated !