In a previous article that said activity monitor, the official explanation is that (Activity Monitor) Displays the CPU, memory, and network usage in real time, recording the system load measured by the virtual memory size. In a plain English, Activity Monitor is similar to Task Manager in Windows and can see in real-time the amount of CPU and memory consumed by the process.
I. Introduction and general use of Activity monitorTo do this, first run instruments from Xcode, and in the menu bar at the top, select product and select Profile (shortcut: Command + I). Call instruments, select Activity Monitor template
When Activity Monitor opens, it looks like this, and all is empty.
When the running device and the running app are ready, we start to run Activity Monitor, click on the Red dot button in the upper left corner, start recording CPU and memory usage in the phone, click on the Pause button in the upper left corner of activity Monitor to get:let's analyze the meaning of these graphs:
%cpu: Percentage of CPU to different processes
CPU Time: CPU Run time
Real Memory Usage: The amount of memory used by the process, using a pie chart and a histogram display just the approximate results of these data we can go to see the specific data, click on 4 any of the images you want to view information, analysis results have 4 kinds of analysis results "Summary, Parent Child, Samples, Console", we have to analyze(1) SummaryThe meaning of the parameters is as follows: Process ID: Progress ID processes Name: Process name User name: Username%cpu:cpu accounted for threads: Thread real mem: real use of Inside Virtual MEM: Architecture: Architecture CPU TIME:CPU Time Sudden Term: unexpected item (2) Parent child its parameters and summary are the same, the content is the same, is more click Process 1 There's one more place to hide. function (3) The samples parameter has the following meanings: Total thread: Bus physical memory Wired: Physical RAM Connection size physical memory active: active physical memory size physical Memory Inactive: Inactive physical memory size physical memory used: The amount of physical memory used (4) console, which is the log information for the console output
Monitoring of memory usage by Activity Monitor
Examining Memory Usage with the Activity Monitor Trace Template
The activity Monitor trace template monitors overall system Activity and statistics, including CPU, memory, disk, and NETW Ork. It consists of the Activity Monitor instrument only, although can add additional instruments to a trace document you ' V E created with the template, if you desire. You'll see later, the Activity monitor is also used to monitor network Activity on IOS devices.
The Activity Monitor instrument captures information about the load on the system measured against the virtual memory size . It can record information from a single process or from all processes running on the system. The Activity Monitor instrument provides you and four convenient charts for a quick, visual representation of the Collect Ed information. The charts that specifically describe memory usage is:
Real Memory Usage (bar graph). Shows the top five real memory users in a bar graph.
Real Memory Usage (pie chart). Shows the top five real memory users with the total memory used displayed.
For activity Monitor instrument with charts
The Record Settings area in the Inspector Sidebar includes a list of system statistics, which can is configured to appear In the track pane and graphically represent collected data. Select a statistic's checkbox to see it graphed in the track pane. Click the shape or the statistic appears in the pane.
There is a number of statistics the Activity Monitor instrument supports, but the following ones is memory-specific:
Physical Memory Wired
Physical Memory Active
Physical Memory Inactive
Physical Memory Used
Physical Memory Free
Total VM Size
VM Page in Bytes
VM Page out Bytes
VM Swap used
If one of the statistics above doesn ' t appear under System statistics, locate it under "Select Statistics to List" and CLI CK It checkbox to include it in the list.
III. Activity Monitor monitors CPU status
There is a number of statistics the Activity Monitor instrument supports, but the following ones is memory-specific:
Cputtotalload
Cpuuserload
Cpusystemload
Cpuniceload
If one of the statistics above doesn ' t appear under System statistics, locate it under "Select Statistics to List" and CLI CK It checkbox to include it in the list. For activity Monitor Instrument tracing CPU Packets
Iv. Activity Monitor monitoring network situation
Following Network Usage Through the Activity Monitor Trace
Template
The activity Monitor trace template monitors overall system Activity and statistics, including CPU, memory, disk, and NETW Ork. It consists of the Activity Monitor instrument only, although can add additional instruments to a trace document you ' V E created with the template, if you desire.
By default, the Activity Monitor template is ' t ' set up to display network Activity. Therefore, need to enable the desired network-related statistics in the Record Settings area in the Inspector sidebar For the Activity Monitor instrument to see which processes is sending and receiving information.
There is a number of statistics the Activity Monitor instrument supports, but the following ones is network-specific:
Net Packets in
Net Bytes in
Net Packets out
Net Bytes out
Net Packets in Per Second
Net Packets out Per Second
Net Bytes in Per Second
Net Bytes out Per Second
If one of the statistics above doesn ' t appear under System statistics in the Record Settings Inspector, locate Itunder "Se Lect statistics to List "and click their checkbox to include it in the list.
Once you had gathered network activity for your app, examine it carefully to pinpoint areas where your app was sending out Excessive amounts of information and therefore tying up valuable device resources. When you minimize the amount of information sent and received, you can benefit from increased performance and response Tim Es in your app.
For activity Monitor Instrument Tracing network packets
Refer to the following articles:
Small white learning instrument activity Monitor
Monitor Memory Usage Using Activity Monitor
Instruments User Guide
Getting Started with Instruments_activity monitor