- Home /
WP Out of Memory
Hey guys, can I borrow your wisdom for a few minutes? I'm developing a 2D game with Unity 4.6.1.f1 and I'm having issues with memory usage in low-end Windows Phone devices (Lumia 520). So,
I already know that WP have limitations with memory usage (180MB in my case)
I did several improvements in my materials and load/unload process
I encoded my sounds and I'm streaming them from the disk.
My point is, I read and followed a lot of articles around the internet about Unity optimization and it doesn't seen to have any effect on WP devices. My game runs smoothly in low-end android devices and iPhone 4S/iPad 2. Can you guys help me? I used the XCode profiler and saw that my game uses (while changing scenes, the moment with higher memory usage) 140MB, which is way less than the WP limit. Here's the Out of Memory error:
Could not allocate memory: System out of memory!
Trying to allocate: 695364B with 32 alignment. MemoryLabel: Texture
Allocation happend at: Line:411 in C:/BuildAgent/work/d63dfc6385190b60/Runtime/Graphics/Texture2D.cpp
Memory overview
[ ALLOC_DEFAULT ] used: 3468146B | peak: 6641054B | reserved: 3954205B
[ ALLOC_GAMEOBJECT ] used: 134088B | peak: 134088B | reserved: 159687B
[ ALLOC_GFX ] used: 120714620B | peak: 120714620B | reserved: 120718714B
[ ALLOC_PROFILER ] used: 13516B | peak: 13516B | reserved: 33526B
Could not allocate memory: System out of memory!
Trying to allocate: 695364B with 32 alignment. MemoryLabel: Texture
Allocation happend at: Line:411 in C:/BuildAgent/work/d63dfc6385190b60/Runtime/Graphics/Texture2D.cpp
Memory overview
[ ALLOC_DEFAULT ] used: 3468146B | peak: 6641054B | reserved: 3954205B
[ ALLOC_GAMEOBJECT ] used: 134088B | peak: 134088B | reserved: 159687B
[ ALLOC_GFX ] used: 120714620B | peak: 120714620B | reserved: 120718714B
[ ALLOC_PROFILER ] used: 13516B | peak: 13516B | reserved: 33526B
(Filename: C:/BuildAgent/work/d63dfc6385190b60/Runtime/Allocator/MemoryManager.cpp Line: 917)
I cannot understand everything in this error message (it's kinda strange to be honest), but I'm guessing the reason is peak in the ALLOC_DEFAULT? I had the same situation before the improvements where the ALLOC_GFX peak was higher than the reserved, but now it seems ok. Can somebody give me a light?
EDIT
Ok, more information. I know that WP != iOS != Android and that compare them is not very uselful is my case. But I couldn't find a way to profile my WP for its memory usage. Unity doesn't find it when I search for its IP and the Visual Studio profiler only gives me CPU usage. That's why I used the iOS profiler just to have an idea.
About compressing the images, they are all compressed (with a few exceptions since they would lost gradient). I even tried to use mipmaping to reduce the image, but the only thing it did was to increase the memory usage for ALLOC_GFX, that's why I left them without it. If anybody needs for information, just ask, please. About the log, does anyone knows how to read it? What does the ALLOC_DEFAULT means?
Windows Phone != Android != iOS, this is silly and using a profiler for one doesn't not equal the others. You could have separate importation settings for each platform. Your textures could be nuts in size and use a very high bit rate, you haven't even mentioned the texture sizes or compression's used on windows phone. There isn't enough information to form an opinion other then your comparisons. Add more information please that is meaningful.
I edited the post, what kind of information you need besides that?
Your answer
![](https://koobas.hobune.stream/wayback/20220613181010im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
The size of the XAP and performance, after the publication in the shop 0 Answers
Performance difference WP8 and Android - Even in a very simple 2D game 1 Answer
Huge memory usage textures 1 Answer
OnAudioFilterRead causes unneccessary GC on WP8? 0 Answers
Unity WP8 Better Performance When Connected to Visual Studio 1 Answer