- Home /
WP8 Profiler Memory Discrepancy
Hey,
I've attached an image showing memory usage as reported via profiling WP8 devices for the app I'm creating. The upper part of the image represents SC01 on a 512MB device (memory limit of 180MB), the bottom part represents SC02 on a 2GB device (memory limit of 570MB).
The problem I'm running into is that the app crashes on 512MB devices via a Application.LoadLevel call from SC01 to SC02, which is because the "Total System Memory Usage" is above 180MB. But there seems to be a chunk of invisible memory being used (at least according to what Unity can see) as the "Used Total" is sitting at a vastly different amount than what the "Total System Memory Usage" and "Commited Total" are reporting.
That invisible difference in SC01 is ~50MB but in SC02, its over 120MB! I am unsure as to what this invisible memory is represented by (.NET related? / XAML related?) but its clearly a significant amount that Unity doesn't have profiling info on.
I've tried inserting a blank scene in between the two scenes in case it was some how a spike from both of them being in memory at the same time, but that lead to me seeing that a blank scene showed a "Used Total" of ~20MB but a "Total System Memory Usage" of ~50MB (literally created a blank project and profiled it on a WP8 device).
While the app is already decently optimized in regards to assets (DTX1 compression where it can be used otherwise DTX5, reduced texture sizes, compressed audio, etc) I have to manually reduce the assets down by ~30MB in SC02 (reducing some textures down to ~8KB from ~2MB, etc) before it stops crashing on transition from SC01. Much less than what would seem to be needed via the SC02 "Total System Memory Usage" which would lead me to believe I would need over 60MB reduced.
Does anybody have any insight into why there is this huge discrepancy between "Used Total" and "Total System Memory Usage" and what it actually represents? Maybe I am just missing something obvious but I would expect a "Used Total" of ~125MB to run fine with a memory cap of 180MB.
I found a post in which the same discrepancy can be scene in the profiler: [http://forum.unity3d.com/threads/tips-and-tricks-make-sure-to-profile-your-phone-apps-memory-usage.202952/] but unfortunately that post doesn't talk about anything relating to it.