Checking Your Application's Memory Footprint

Memory management is especially important on embedded platforms. Storyboard provides a few ways to view an estimation of your application's footprint on your target.

The most obvious example of this is the Application Footprint Preview in the Storyboard Application Export Configurations window:

This provides a simple estimated overview of your application’s memory and storage size, which can be incredibly useful.

Today I want to take a look at the lesser known option which comes from the Model Manager plugin: mem_stats

To enable this you would pass the following option to sbengine:

-omodel_mgr,mem_stats=1

This option reports the memory usage statistics of your application at initialization as well as termination. Additionally, if the metrics plugin is loaded then it will also provide the estimate of the current application's in-memory structure cost.

Here is an example of what the mem_stats option can provide:

1 Model Estimated Usage
2   Total; ( Count @    Fixed) +  Dynamic {+ Overhead}; Name
3     448; (     1 @      136) +      296 {+       16}; Application
4     788; (     6 @       32) +      348 {+      248}; Screens
5   1612; (    13 @       64) +      444 {+      336}; Layers
6   1296; (    27 @       48) +        0 {+        0}; Layer Instances
7   2432; (    19 @       68) +      580 {+      560}; Groups
8     128; (     1 @      128) +        0 {+        0}; Tables
9   4864; (    76 @       64) +        0 {+        0}; Controls
10   8912; (    84 @       36) +     5888 {+        0}; RenderExt
11     440; (    10 @       16) +      248 {+       32}; Actions
12       0; (     0 @       24) +        0 {+        0}; Animation
13       0; (     0 @       28) +        0 {+        0}; Animation Step
14     872; (   108 @        8) +        0 {+        8}; Data Manager
15       0; (     0 @      112) +        0 {+        0}; Scroll
16 Model Usage Total 21792 bytes
17 String (pooled) Usage Total 11485 bytes

Utilized together, the Application Footprint Preview and mem_stats option are powerful tools that can make resource analysis much simpler.

0

Comments

0 comments

Please sign in to leave a comment.

Didn't find what you were looking for?

New post