How to add and use "ObjectAlloc" and "MallocDebug" in the instrument tool - iphone

I am trying to know memory allocated to each view in my App.I am doing it via instruments provided in Xcode.
When i am using instrument in xcode then i am able to see the Tools for leaks and allocation but i am unable to see "ObjectAlloc" and "MallocDebug" tools.
I searched this in the instrument library but it was not showing in the list.
So how to use that tool..
is there any better tool to know memory at each step in my app
Thanks and regards

These are older standalone apps that you seek, formerly distributed with Xcode.
ObjectAlloc: search "Allocations" in Instruments' Library.
MallocDebug: Generally, you'll just set these variables in Xcode's Product Scheme Editor, at Run PRODUCT > Diagnostics > Memory Management.
Options can be found here.

Related

Separate Applications for iPad1-2 and iPad3-4

Is it possible to restrict applications to only run in iPad3 and iPad4?
I have an application which has memory leak, most probably on iPad 1-2.
I want to restrict my application.
Answering to your question, that's not possible right now, you can restrict the version of iOS, but not the device.
About your problem, as other people is saying, fix your code because you are leaking somewhere, you get the risk of Apple rejecting it too.
The best way to check it is analysing your code (Product > Analyze), also run the Instruments (Product > Profile) and check the memory leaks.
The best option is fixing your leak.
If you still want to restrict usage of your application you can use the UIRequiredDeviceCapabilities list. add a capability in your plist called auto-focus-camera. This functionality is available starting the 3rd generation iPad.
Keep in mind that this is not the best option
Here is the capabilities list sorted by device

"Leaks Discovered" but not shown in detail via Instruments

I am attempting to obtain information on possible leaks that exist in the iPad app I am currently developing. Typically when Instruments finds a leak, a red 'peak' appears on the graph within the leaks section and I am able to obtain information on that leak within my code. Currently, Instruments is instead telling me "Leaks Discovered", but there are no peaks on the leaks graph and no details are shown. Any idea on why that might be?
Not sure unless there's more information but I generally use "Build and Analyze" and fix all the leaks it shows there and only then move on to Instruments. Try Build and Analyze to see if it shows any leaks there. If you're using Xcode 4, its just Analyze under Product.

Is it possible to load other applications in Instruments?

I’d like to use Instruments to peek at some third-party applications on my iPhone, is that possible? If I attach Instruments to some of the applications I develop, everything goes well. But when I try to load some other application, Instruments complain that they can’t “get task for pid XY.” Is that a security measure?
This is the iPhone telling you that the app you're trying to run won't let the debugger attach to it. Without a debugger attached you can't run Instruments.
This is an intentional security measure, withut hacking the 3rd party apps you will not be able to view them in Instruments.
Hey.
From Instruments documentation:
For your protection, the instrument does not allow you to process any application that is not
code-signed with your provisioning profile. This includes any copy that has been downloaded from the iTunes App Store.

iPhone: iPhone application testing

First, Thanks to all for your quick help for any questions asked in this forum.
I just want to know what are the testing tools coming up with Xcode on Mac as i need to test my iPhone application professionally (or) What do you suggest to use debug and test my application using any (or) built-in tools?
Thanks.
The first thing I try is Xcode's "Build and Analyze" menu command.
Next thing is to run Instruments and look for memory and object allocations and disposal. Instruments should keep you busy for quite a while as it can provide you a wealth of information, including network performance and graphics utilization.
When using instruments, the first method you should check is memory allocation and leaks. When your application leaks, it will spike. Click on this leak and then extend the details to find the exact whereabouts of the leak.
However read the documentation on it all first.
Documentation

What is a good performance profiler for iPhone games made w/ objective-C and XCode?

I'm writing an iPhone game in objective-C using XCode. I'd like to profile the performance of my code. What is a good profiler to use?
Have you tried Shark? it comes with the developer tools.
Apple provides a program called Instruments, which is included with the iPhone SDK download, that really is excellent. It allows you to view memory leaks, animation performance, and a bunch of other stuff.
The developer tools you downloaded also included a great app called Instruments. You'll find it in your Developer folder next to Xcode:
/Developer/Applications/Instruments.app
Instruments works great for profiling and also has some preset modes that you can use to track down memory leaks, view how many instances of various objects have been created, monitor your OpenGL performance, etc.
To use Instruments, just build your app in Xcode, then while still in Xcode, launch Instruments from:
Run > Start With Performance Tool > Instruments Templates
…then select the type of performance monitoring you'd like to do.
Shark is an incredible profiler, included as part of Apple's CHUD tools, with XCode. If you can get that to run in, say, the simulator, you will be extremely pleased with the results it provides.
Just wanted to plug a set of profiler macros I created for iPhone. You can profile in the traditional sense vs sampling w Shark. It also doesn't require any special tools and the output is saved to a file in your app's Documents folder.
http://code.google.com/p/iphone-quick-profiler/
.n