• Monitor Memory Usage


    监视内存使用情况Monitor Memory Usage

     

    与其他运行在系统上的进程相比较,使用活动监视器概要模板来跟踪应用程序的真实内存和虚拟内存的使用情况。Use the Activity Monitor profiling template to track your app’s real and virtual memory use in comparison to other processes running on the system.

    创建跟踪文档以监视总体内存使用情况To create a trace document to monitor overall memory usage
    1. 运载工具。Launch Instruments.

    2. 在出现的剖析模板选择对话框中,单击活动监视器。In the profiling template selection dialog that appears, click Activity Monitor.

    3. 从目标设备和流程列表中选择您的设备和应用程序。Choose your device and app from the target device and process lists.

    4. 单击“选择”创建跟踪文档。Click Choose to create a trace document.

    活动监视器的仿形模板包括活动监测仪,它是预先显示系统负载和虚拟内存的大小。您可以启用其他与内存相关的统计信息,以便通过检查窗格查看。The Activity Monitor profiling template includes the Activity Monitor instrument, which is preconfigured to display system load and virtual memory size. You can enable other memory-related statistics for viewing via the inspector pane.

    启用活动监视器内存统计信息的显示To enable display of Activity Monitor memory statistics
    1. 记者command-1显示督察窗格记录设置区域(如果它不是已经打开)。Press Command-1 to display the record settings area of the inspector pane (if it’s not already opened).

    2. 在检查人员的统计列表区域中,选择要查看的与内存相关的统计信息。In the statistics to list area of the inspector, select the memory-related statistics you want to see.

      下列与内存相关的统计信息可供显示:The following memory-related statistics are available for display:

      • 物理内存连接操作系统所使用的内存量。Physical Memory Wired—The amount of memory being used by the operating system.

      • 物理内存活跃于除操作系统以外的进程所使用的内存量。Physical Memory Active—The amount of memory being used by processes other than the operating system.

      • 物理内存不激活最近发布的内存量。Physical Memory Inactive—The amount of memory that was recently released.

      • 物理内存使用执行样例时所使用的内存总量。Physical Memory Used—The total amount of memory that was used while performing the sample.

      • 物理内存释放可用内存量。Physical Memory Free—The amount of available memory.

      • 虚拟内存的总大小。Total VM Size—The total size of virtual memory.

      • 以字节为单位发送给ram的内存调用量。VM Page In Bytes—The amount of memory calls sent to RAM.

      • 虚拟机分页字节发送到磁盘的内存调用量。VM Page Out Bytes—The amount of memory calls sent to disk.

      • VM交换使用从磁盘调用的内存量。VM Swap Used—The amount of memory called from disk.

    3. 在系统统计区域中,选择您希望看到的与内存相关的统计信息。如果需要,单击形状或颜色控件,以更改统计数据在时间轴中的表示方式。In the system statistics area, select the memory-related statistics you want to see. If desired, click the shape or color controls to change how the statistics are represented in the timeline.

    收集总体内存使用细节To gather overall memory usage detail
    1. 单击“记录”按钮在工具栏或按command-r开始记录。Click the Record button (image: ../Art/inline_record_button_2x.png) in the toolbar or press Command-R to begin recording.

    2. 正常使用你的应用程序。Use your app normally.

      由于活动监视工具对应用程序进行概要分析,它定期执行示例,并将结果显示在时间轴和详细窗格中。As the Activity Monitor instrument profiles your app, it performs samples at periodic intervals and displays the results in the timeline and detail panes.

    3. 请单击“停止”按钮在工具栏或按command-r再次当你准备停止记录。Click the Stop button (image: ../Art/inline_stop_button_2x.png) in the toolbar or press Command-R again when you’re ready to stop recording.

    TIP

    当你的应用程序被概要化时,在时间轴中单击选项来插入标志,指示你执行特定任务的地点。例如,您可以在创建新文档之前和之后添加标志。在探索捕获的数据时,您可以跳到标记区域进行分析。As your app is profiled, Option-click in the timeline to insert flags that indicate where you performed specific tasks. For example, you might add a flag before and after you create a new document. When exploring your captured data, you can jump right to the flagged area for analysis.

    时间线窗格提供了所收集数据的图形表示。通过时间轴滚动来了解应用程序和系统上运行的其他进程如何使用内存。要进行更详细的分析,请在详细窗格中探索结果。The timeline pane provides a graphical representation of the data collected. Scroll through the timeline to gain an understanding of how memory is being used by your app and other processes running on the system. For more detailed analysis, explore the results in the detail pane.

    通过示例查看摘要内存使用情况To view summarized memory usage by sample
    1. 单击时间轴中的活动监视器跟踪。Click the Activity Monitor track in the timeline.

    2. 从详细窗格的导航栏中的“详细类型”列表中选择示例。Choose Samples from the detail type list in the navigation bar of the detail pane.

    在分析过程中,在某个特定的点上查看进程的详细内存使用情况To view detailed memory usage by a process at a specific point during profiling
    1. 单击时间轴中的活动监视器跟踪。Click the Activity Monitor track in the timeline.

    2. 记者command-2显示检查员的窗格显示设置区(如果它不是已经打开)。Press Command-2 to display the display settings area of the inspector pane (if it’s not already opened).

    3. 在督察的详细流程跟踪区域,单击“跟踪检查头”来配置明细窗格,以根据时间轴中当前选定的区域显示结果,而不是执行最新的示例。In the process detail tracking area of the inspector, click “Track inspection head” to configure the detail pane to display results based on the currently selected area in the timeline, rather than the latest sample performed.

    4. 在时间轴中选择一个点来查看当时捕获的统计数据。Select a point in the timeline to view the statistics that were captured at that time.

    5. 在详细窗格中查看内存使用情况统计信息。View memory usage statistics in the detail pane.

      使用明细类型列表在收集的数据的汇总视图之间通过进程或父子视图切换。Use the detail type list to toggle between a summary view of the collected data by process or a parent child view.

  • 相关阅读:
    bash变量作用域问题
    grep sed awk find用法
    vim compare 比对
    python的位数问题
    mysql使用
    lua 学习
    iptables的使用
    地铁换乘
    NOJ 1063 生活的烦恼
    猴子的下落
  • 原文地址:https://www.cnblogs.com/zyingn/p/Monitor_Memory_Usage.html
Copyright © 2020-2023  润新知