How to display iPhone free memory in a UILabel ?
and I would like to ask, how to free up memory using iPhone SDK?
FYI, I’m using iPhone SDK 3.1.2 with xcode 3.2.1 (Mac OS X Snow Leopard).
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is no direct access to this information in the SDK, and apps are not allowed to mess around with the OS the way you’re suggesting. You’re in your own little box; Apple expects you to stay there. When you ask questions that include “the system,” you are probably outside of your box.
That said, there are some tricks you can use. You can allocate increasingly-large blocks of memory until you receive
-didReceiveMemoryWarning. At that point, release your allocated memory. That will give you a rough idea of how much memory the OS will allow you to have. That’s not the same as how much the OS has of course. Tripping-didReceiveMemoryWarningwill also cause the OS to do some housekeeping of its own, so this is pretty much the most effective programmatic way you have to free up memory.The most effective non-programmatic way to free up memory is to ask the user to reboot. For applications that require substantial memory (generally games), this approach is not unheard of.
SBSettings requires jailbreaking and is outside of the SDK.