Nikita P
Nikita P

Reputation: 4246

Using instruments to find overflow of the stack in code

As Documents say, allocations give a heap analysis of the memory.

However, what I feel is my app is crashing because of storing a lot of data on stack, which might be overflowing.

How do I analyze that? Please Help. Thanks!

Upvotes: 0

Views: 78

Answers (2)

Pranav Jaiswal
Pranav Jaiswal

Reputation: 3752

First Build your app for Profiling (Command +I); Run it. Select the Allocations tool, Play around with (Use) the application.

In the Allocations you will find a section of Live Bytes this is the current RAM utilization by your application (data on stack I suppose it's the RAM you are talking abt in your question).

Releasing Objects that are not currently in use will reduce Live bytes

Overall Bytes - All bytes (Created & Destroyed + currently live bytes).

For Further reference refer Instruments Programming Guide.

Upvotes: 1

Nenad M
Nenad M

Reputation: 3055

Creating and comparing "heapshots" is a good way to start narrowing down the code parts that show no obvious memory management errors at first glance. See my answer on this question for some further reading or check out this great article directly.

Upvotes: 0

Related Questions