BT
x Your opinion matters! Please fill in the InfoQ Survey about your reading habits!

A New Garbage Collector and Memory Profiler for iOS/MonoTouch

by Jonathan Allen on Feb 20, 2012 |

MonoTouch for iOS now supports the generational garbage collector SGen. Until recently this was an experimental option only available on the full version of Mono. Along with it comes a Memory Profiler for iOS that it accessible via the MonoDevelop IDE.

The generational garbage collector SGen replaces Mono’s traditional Boehm garbage collector. While it is expected to have better performance, SGen is still hampered by its conservative scanning. In the future SGen is expected to switch to a precise stack marking system which should significantly reduce nursery fragmentation.

The iOS profiler supports two modes, the default being Heap Analysis. In this mode memory snapshots can be taken on demand or by a trigger. The trigger can be set to a certain number of garbage collection cycles or a time-based interval. Standard tools such as comparing snapshots and determining how an object is rooted in memory are included.

Performance Analysis supports statistical sampling and the more accurate but slower enter/leave event logging. Statistical sampling takes snapshots of the application and estimates how fast each method is based on how often it happens to be caught by the sampler. Enter/leave event logging literally records a log entry each time a function is begun or completed. This offers a complete record of where time is being spent, but at a serious performance cost. This mode can also capture the stack traces associated with object allocation.

MonoDevelop 2.8.5 and MonoTouch 5.1.1 are required to use this tool. For the particular project, the debugging, profiling, and the SGen garbage collector options must be enabled.

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT