Hatena::ブログ(Diary)

Over&Out その後 このページをアンテナに追加 RSSフィード Twitter

2011-11-18

Stats : Class to monitor the real-time memory usage in iOS app

What is "Stats"

"Stats" is a class to display set of parameters that indicate the load status such as memory usage, the number of UIView subclasses to create a directly below in real time.


When you run the included sample project will appear like this. (Stats is the black label in the upper left)


f:id:shu223:20110428232915p:image:w240


You will see that it is using about 16MB of memory, a total of five views. (run in the simulator)

Also, you can also see a slight rise in the CPU load when you hit the button to draw image.



Parameters and the units

From top to bottom,

  • The variation of memory usage [kB]
  • The total memory usage [kB]
  • The variation of CPU time [msec]
  • The number of UIView subclasses


How to use

A sample project is included.

https://github.com/shu223/Stats


  • Add Stats.h, Stats.m to your project
  • Import Stats.h
  • As with UILabel, add wherever you like.
self.stats = [[[Stats alloc] initWithFrame:CGRectMake(10.0, 30.0, 100.0, 60.0)] autorelease];
[self.view addSubview: stats];


スパム対策のためのダミーです。もし見えても何も入力しないでください
ゲスト


画像認証

2009 | 08 |
2011 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 |
2012 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 |
2013 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 |
2014 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 |