その後のその後

iOSエンジニア 堤 修一のブログ github.com/shu223

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)



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];