内存泄漏检测(预览)Memory leak detection (preview)

Application Insights 自动分析应用程序中每个进程的内存消耗量,并可以就可能的内存泄漏或内存消耗量增加向你发出警告。Application Insights automatically analyzes the memory consumption of each process in your application, and can warn you about potential memory leaks or increased memory consumption.

此功能需要配置性能计数器,除此之外,不需要其他特殊设置。This feature requires no special setup, other than configuring performance counters for your app. 当应用生成的内存性能计数器遥测数据(例如,专用字节数)足够多时,它处于活动状态。It's active when your app generates enough memory performance counters telemetry (for example, Private Bytes).

何时会收到此类型的智能检测通知?When would I get this type of smart detection notification?

在属于你应用程序的一个或多个进程和/或一个或多个计算机中,如果内存消耗量在较长的时间段内持续增加,将发出一个典型的通知。A typical notification will follow a consistent increase in memory consumption over a long period of time, in one or more processes and/or one or more machines, which are part of your application.

我的应用真的有问题吗?Does my app really have a problem?

不是,通知并不意味着应用肯定有问题。No, a notification doesn't mean that your app definitely has a problem. 虽然内存泄漏模式通常指示应用程序有问题,但这些模式可能对特定进程而言是非常典型的,或者可能有自然的业务理由,并且可以被忽略。Although memory leak patterns usually indicate an application issue, these patterns could be typical to your specific process, or could have a natural business justification, and can be ignored.

如何解决问题?How do I fix it?

通知包括诊断信息,以在诊断分析进程中提供支持:The notifications include diagnostic information to support in the diagnostic analysis process:

  1. 会审Triage. 通知显示增加的内存量(以 GB 为单位),以及内存增加的时间范围。The notification shows you the amount of memory increase (in GB), and the time range in which the memory has increased. 这可以帮助你对问题分配优先级。This can help you assign a priority to the problem.
  2. 划分范围。Scope. 多少台计算机表现出内存泄漏模式?How many machines exhibited the memory leak pattern? 可能内存泄漏期间触发了多少个异常?How many exceptions were triggered during the potential memory leak? 可以从通知中获取此信息。This information can be obtained from the notification.
  3. 诊断。Diagnose. 检测包含内存泄漏模式,该模式显示随时间推移进程的内存消耗量。The detection contains the memory leak pattern, showing memory consumption of the process over time. 还可以使用链接到支持信息的相关项和报告,帮助进一步诊断问题。You can also use the related items and reports linking to supporting information, to help you further diagnose the issue.