BT

New Early adopter or innovator? InfoQ has been working on some new features for you. Learn more

A New Garbage Collector and Memory Profiler for iOS/MonoTouch

| by Jonathan Allen on Feb 20, 2012. Estimated reading time: 1 minute |

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.

Rate this Article

Adoption Stage
Style

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

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and dont miss out on content that matters to you

BT