Every RAM must have stack and heap (like CS,ES,DS,SS 4 segments).but is there like stack size in iphone,is only heap available?some tutorial say when we increase stack size , heap will be decreased,when we increase heap size ,stack will be decreased ...is it true..? or fixed stack size or fixed heap size ? any help please?
Asked
Active
Viewed 3,377 times
-4
-
1This question is very badly phrased. What do you really want to know? This may be the same question as http://stackoverflow.com/questions/1869031/what-is-the-application-heap-size-in-iphone – Arafangion May 27 '10 at 05:38
1 Answers
15
RAM does not have stack and heap (these are program use constructs and not part of the memory physically), nor do the Intel segment registers apply to ARM.
An application's thread, since it is a C application, has a stack. The stack size is bounded on the device, and in most cases cannot exceed a certain size (1MB for the main thread on iPhone OS), nor can it be shrunk.
Heap is also limited. The only way your stack size can influence the available heap is by creating threads, where the new stacks will occupy memory which could be used by the heap allocator. On iPhone OS, the minimum stack size is 16KB. For more information, read the threading documentation.

Yann Ramin
- 32,895
- 3
- 59
- 82
-
1The stack is in RAM. The stack is not a property of the RAM - its a logical construct. The iPhone has an ARM processor which has nothing to do with an Intel architecture machine and henceforth does not even have segment registers. – Yann Ramin May 28 '10 at 05:25