Phone gets heated when running my application - iphone

When I use my application for awhile, I have noticed that the device gets hot. Apple devices usually get hot when running applications, so I want to know if there's a method to check if I have done something wrong in my application.
I don't think the Allocations tool in Instruments could help me diagnose the problem.

Instruments can definitely help you solve this. Your device gets hot as a direct result of intense CPU activity, which Instruments can track and show you your CPU usage and memory allocations.

Related

How does the Instruments stop working automatically?

I try to monitor the allocation through Instruments.
However, when I run to a point, sending some jabber msg, the Instruments stop working automatically.
I wonder how does it stop.
Is there any code in an app could stop the Instruments?
I have faced this problem too. The answer i got was: Instruments does stop if your memory usage is too high. Turn on Allocations, and see the memory usage. In my app, I was calling web services, which were downloading some heavy data, because of which my app's memory consumption would go unto like, 60-70 MB, (for an iPad app). This was causing instruments to crash.
So I had to put some memory fixes. I was able to reduce it to around 12 MB. And then Instruments resumed to work fine. Hope it helps.
It could also be as #Cory Kilger suggests and the app is crashing.
Try running it outside of instruments.
Good luck :)

(iPhone)Instruments question

Just wondering if my iPhone application should be running slow when I put it through instruments? When I test my app using instruments, it goes extremely slow and is frustrating to use.
Thanks.
Yes, this is normal as Instruments is constantly monitoring the app's process, which causes the app to run considerably slower than normal.
I faced similar situation. When instrument gathers data, the app seems to hang up. And this is natural.
Yeah, I think that instruments affect your application being monitored. You can/should try in the real Iphone device to see the real performance
Hey.
And more different instruments you load int Instruments the slower it gets.

How much memory is my iphone app using (from Simulator)

I know this has something to do with Instruments, but well it's kind of confusing and searching for Instruments on Google doesn't help much.
I'd like to know how well my app runs, like how much memory it uses. I just don't know where to find something like:
"As close as we can tell from the simulator you'll app will currently be using xx MBs of RAM on a real iphone device."
I need help on how to get this information.
You shouldn't test your memory usage in the simulator for a number of reasons, some of which are:
The simulator is running on your computer, not the phone, so the maximum amount of memory is the same as the amount of ram you have installed in your Mac.
The simulator, and your app when build with the simulator SDK, do not use the same libraries as they would on the device, and as a result, could use a different amount of memory.
However, if you can run on a device, you should use the Memory Monitor and Object Allocations instruments in Instruments to monitor your memory usage.
You should use the Run/With Performance Tools/Object Allocations. The graphs will show you the memory used.
And then you check the box "Created and Still Living" to know what objects are in memory.

Game crashes on the actual iPhone but simulator? memory problem?

I have built my first game using Cocos2D. It worked fine on the simulator. But when it runs on the actual iPhone, it crashes. I don know why. Thought it was memory leaks, so i tried to detect, but no leaks found. I tried to increase and decrease frame rate, neither both succeeded. Anyone experienced please help me out. I am really stressed now. If anyone had the same issue please share with me your opinion.
Yours thanksfully.
I've run into similar issues (I also use Cocos, but I don't think this is Cocos specific). The best thing to do is plug-in your iPhone and watch the stacktrace when it crashes (or retrieve the stacktrace after the fact)
This happened to me a lot because the resources between the iPhone and the simulator were not in sync; in other words, some how resources would be available to the simulator (eg: images) but those same resources were not transferred to the iPhone for whatever reason. Sometimes, if I ran 'clean' on the simulator, I would observe the same issue.
It's extremely frustrating to debug these types of issues, but you'll get used to it.
I agree with Dominic - we definitely need more information to be able to help you - do you have the output from the console or the stack from the debugger?
Also, while memory leaks are a Bad Thing, they rarely lead to crashes directly. They will increase the amount of memory used by your app so if you're memory intensive then you might get a problem but they're not the first place I'd look to try to debug this.
Try running the app in Instruments and watch the memory usage graph - then not only can you see the total that your app is using but you can get an idea of which sections of your app use the most and can focus your efforts in reducing it.
Sam
Sorry, but you need to specify more details. How does it crash? What does the error log say? One thing you might look into is the amount of memory, your game consumes. If it uses more than 64 MB on the actual device, the OS will very likely just terminate it. In the simulator on the other hand, your app might use lots more memory without a problem.
I have found tools like Instruments and NSZombieEnabled to be very helpful in tracking down issues such as these.
Without more information, I would try the following steps:
Delete the app from the device and simulator (using the tap-and-hold technique to make your icons jiggle) and reinstall it. Sometimes a setting (or lack of a setting) in the user defaults will cause a crash, and those don't get wiped out unless you delete and re-run your app.
Also try the "simulate memory warning" option in the simulator and see if that gets it to crash.

Predicting performance for an iPhone/iPod Touch App

I don't have an iPhone Developer Program Account yet and will be getting one in the next couple of days. Can instruments be used with the simulator to give a rough estimate on how well my app may perform? Using instruments I checked and fixed all the leaks it was detecting, and it appears that my memory usage maxes out at about 5.77mb. Is there any other tests I could perform with instruments to judge how well my app would perform? I realize there is no way other then the actual device to get a definite answer, it would be nice to get an estimate.
Keeping memory under control is a good first step. Also, make sure you're not allocating too many objects, as all those allocations can take time (use ObjAlloc to check this; it can show you things that Leaks cannot).
Comparing performance between the Sim and Device is pretty much pointless... you have effectively unlimited memory can CPU on the desktop. Best wait until you get your app installed on an actual device.
You could test with a jailbroken device while you're waiting for your developer account. By the time you get your account, you would have time to fix any potential problems, and only need to recompile with your new credentials and deploy.