How do you determine RAM budgets?

Hello!

I want to set RAM budgets for our game. Like limits for textures, scripts, animations, models, audio, the heap, etc. as the game runs.

  • How do you determine what is the maximum amount of RAM the app can safely use?
  • What tools or methods do you use for measuring RAM usage?
  • Are there any examples of how people have set these budgets? Like how many MBs are available for textures vs how many MBs are available for audio.

Thanks for any thoughts and ideas!

Totally depends on target platform (mobile? PC? console?). Each has its own issues, plus both hard and soft limits. As with all engineering, everything is a tradeoff: time to develop, space consumed, appearance of final product, etc.

I work in mobile mainly, but the questions remain for other platforms as well.

How do you determine your hard and soft limits? Why have a soft limit if there’s a hard limit as well?

Let’s use an example. We are supporting all iOS 9 devices. How much total RAM can our product use? I think if I can figure this out, then I can start working towards RAM budgets so that our art team knows exactly how much art we can display at once.

Half the lowest end device’s total ram that you support. So if this is a 512mb device, 256mb is the max. Likely, your lowest end choice will have more.

This is something I’ve found that’s quite safe on mobile, given the amount of apps people use, which are often shunted in and out of ram. We found half the total ram made everything play nice and was reliable on all the devices.

3 Likes

In addition, this guy came up with a table listing crashes for apple devices stackoverflow link
device: (crash amount/total amount/percentage of total)

  • iPad1: 127MB/256MB/49%
  • iPad2: 275MB/512MB/53%
  • iPad3: 645MB/1024MB/62%
  • iPad4: 585MB/1024MB/57% (iOS 8.1)
  • iPad Mini 1st Generation: 297MB/512MB/58%
  • iPad Mini retina: 696MB/1024MB/68% (iOS 7.1)
  • iPad Air: 697MB/1024MB/68%
  • iPad Air 2: 1383MB/2048MB/68% (iOS 10.2.1)
  • iPad Pro 9.7": 1395MB/1971MB/71% (iOS 10.0.2 (14A456))
  • iPad Pro 10.5”: 3057/4000/76% (iOS 11 beta4)
  • iPad Pro 12.9” (2017): 3057/3974/77% (iOS 11 beta4)
  • iPod touch 4th gen: 130MB/256MB/51% (iOS 6.1.1)
  • iPod touch 5th gen: 286MB/512MB/56% (iOS 7.0)
  • iPhone4: 325MB/512MB/63%
  • iPhone4s: 286MB/512MB/56%
  • iPhone5: 645MB/1024MB/62%
  • iPhone5s: 646MB/1024MB/63%
  • iPhone6: 645MB/1024MB/62% (iOS 8.x)
  • iPhone6+: 645MB/1024MB/62% (iOS 8.x)
  • iPhone6s: 1396MB/2048MB/68% (iOS 9.2)
  • iPhone6s+: 1392MB/2048MB/68% (iOS 10.2.1)
  • iPhoneSE: 1395MB/2048MB/69% (iOS 9.3)
  • iPhone7: 1395/2048MB/68% (iOS 10.2)
  • iPhone7+: 2040MB/3072MB/66% (iOS 10.2.1)
1 Like

Or… half to be on the safe side :stuck_out_tongue:

3 Likes

Crashes at around 70% on newer devices. Pretty sure OP can bust 50 safely.

Half the lower end. I have a lot of experience on mobile with clients and our own apps. You don’t want to be busting it, in fact unless you have manpower to spare, you should be half your lowest target device. This is going to be something like 25% of a high end device. Way, way less.

Unless of course you’re going to have asset bundles for each device tier you support and you have enough staff, or you decide not to sell to the majority of the market.

Working in the production mobile space for casual games, I can confirm this estimate.

You are asking for trouble if you go over it.

Remember there is always transient allocations going on, particularly during scene transitions or asset loading.

Unity does a fantastic job of keeping it all together but once you start getting low memory warnings, you’ve already done something wrong, start making your app footprint smaller ASAP.

ALSO: use the detailed memory dumps in the profiler. You will be amazed at what bits of what is taking memory on your target platform.

1 Like

I stand corrected then. On top of that, I misread OP. Initially, I thought he meant budgets plural because he wanted to do things differently based on the device.

1 Like

Thanks everyone! This definitely helps me start to come up with some plans!

We will be serving different quality art assets for low end devices vs high end devices. This will help me know which devices should get which art assets.

My next step is to automatically track RAM usage on our debug builds. It seems like newer versions of Unity can make this easier with the Profiler class.

If you have any other tips for automatically tracking RAM usage, I’m all ears! (Or is it eyes since I’d be reading it?)