- Home /
Detect how much RAM is available? (iOS)
Is there a way to detect programatically how much RAM is available on iOS (preferably on Android too)? How do I detect how much RAM is being used by my app?
I've never used this, but it seems to be what you need:
SystemInfo.system$$anonymous$$emorySize
http://docs.unity3d.com/ScriptReference/SystemInfo-system$$anonymous$$emorySize.html
Good stuff! I'll check it out. But how about free memory, i.e. memory that can be allocated by an app?
I can't say about iOS cause I haven't yet targeted iOS.
For Android this is the way I'd go:
Use either AndroidJavaObject or AndroidJavaClass to be able to call Java methods:
http://docs.unity3d.com/ScriptReference/AndroidJavaObject.html
http://docs.unity3d.com/ScriptReference/AndroidJavaClass.html
Then...
getRunningAppProcesses will get you a list of PIDs, and then getProcess$$anonymous$$emoryInfo will give you memory details about them.
http://developer.android.com/reference/android/app/Activity$$anonymous$$anager.html
Hope this helps.
Answer by Bunny83 · Dec 16, 2014 at 08:08 PM
Those systems (iOS and Android) don't clear the memory. They usually keep the last used Apps in memory. They simply kick out the oldest application when the system / active app needs memory. So ideally the whole memory is in use. Even when you get a value for the unused memory, you most likely can use more than that.
Your answer
Follow this Question
Related Questions
android memory, VRAM max usage? 0 Answers
Memory usage for the simplest iOS/Android app grows over time, says Unity 3.5 Profiler 0 Answers
OutOfMemoryException when downloading files via the www class (iOS and Android) 1 Answer
iOS memory inconsistent between builds 0 Answers
Can I load textures at runtime with a smaller memory footprint? 1 Answer