jowie
jowie

Reputation: 8068

Unity-based application crashes on iPad 1 when memory exceeds 40MB

I know this might be fairly Unity-specific, but the reason I am asking it here is because this is more of a general question regarding iPads and memory usage...

We have a Unity3D game project (not created by me, but I'm trying to help work out why it is crashing). It contains approximately 8 textures loaded at any one time, all 512x512 in size. There are probably no more than about 10,000 polygons on the screen in-game.

When we run it through Instruments on an iPad 2, it peaks at around 60 MB, which seems like it's well within the memory capabilities of that machine. However, when we try to run it on an iPad 1, even after a reboot to clear memory, Instruments shows it get to about 40 MB of loading before it crashes.

Would there be any reason why the iPad 1 cannot cope with more than 40 MB? I am aware the iPad 1 only has 256 MB compared with the iPad 2's 512 MB, but surely this is still well within the device's capabilities?

EDIT: The iPad 1 is running iOS 4.2.1 and the iPad 2 is running iOS 5.1.

Upvotes: 2

Views: 1880

Answers (2)

MoDJ
MoDJ

Reputation: 4425

You do not need to toss out iPad1 support to get your app working. The way you can avoid this problem is to decompress the textures and then write each one to a file. Then, memory map each file and use the memory mapped address instead of the normal memory address. An iOS device can map about 700 megs of data from a file in this way and you can send the memory to the graphics card in the normal opengl way.

Upvotes: 0

MacTeo
MacTeo

Reputation: 2686

We don't know the iOS version installed on the iPad 1 and it can variate the base memory used by the OS.

With my experience, a 40MB limit is in line with the 30-50MB range I'm used to see on Apple devices with just 256MB of RAM, before the memory warning is called.

Upvotes: 1

Related Questions