上一主题: 启用和禁用 LeakHunter下一主题: 忽略会导致性能下降的集合


配置 LeakHunter 属性

LeakHunter 配置属性位于代理配置文件 IntroscopeAgent.profile 中。

配置 LeakHunter

  1. 打开代理配置文件 IntroscopeAgent.profile
  2. 根据需要配置以下 LeakHunter 属性:
    introscope.agent.leakhunter.logfile.location

    指定 LeakHunter.log 文件的位置。 文件名相对于 <IntroscopeAgent.profile> 目录。 如果该属性已注释掉或保留空白,则不会写入任何日志文件。

    默认值为 logs/LeakHunter.log

    introscope.agent.leakhunter.logfile.append

    指定在应用程序重新启动时替换日志文件(值为 false)还是附加现有的日志文件(值为 true)。

    默认值为 false。

    introscope.agent.leakhunter.leakSensitivity

    指定检测内存泄漏的敏感级别。 较高的泄漏敏感设置将导致报告较多的潜在泄漏,较低的敏感设置则导致报告较少的潜在泄漏。

    属性值必须是 1-10 的整数。

    默认敏感级别为 5。

    introscope.agent.leakhunter.timeoutInMinutes

    指定 LeakHunter 查找潜在的新泄漏过程的时间(分钟)。 该属性值必须是非负整数。 值为零表示没有超时。

    默认值为 120 分钟。

    introscope.agent.leakhunter.collectAllocationStackTraces

    指定是否收集分配堆栈跟踪信息。 启用该选项可能会导致系统 CPU 使用率和内存较高。 对此属性所做的更改可立即生效,不需要重新启动托管应用程序。

    默认值为 false。

    introscope.agent.leakhunter.ignore.n

    指定希望 LeakHunter 忽略的特定收集。

    对于常规集合,请使用包含常规类型限定的语法,例如:system.Collections.Generic.List`1

    对此属性所做的更改可立即生效,不需要重新启动托管应用程序。

    这些属性(其中 n=0-4)的默认值为:

    introscope.agent.leakhunter.ignore.0=org.apache.taglibs.standard.lang.jstl.*
    introscope.agent.leakhunter.ignore.1=com.bea.medrec.entities.RecordEJB_xwcp6o__WebLogic_CMP_RDBMS
    introscope.agent.leakhunter.ignore.2=net.sf.hibernate.collection.*
    introscope.agent.leakhunter.ignore.3=org.jnp.interfaces.FastNamingProperties
    introscope.agent.leakhunter.ignore.4=java.util.SubList
    
  3. 保存对代理配置文件所做的更改。

重要信息! IntroscopeAgent.profile 包含用于控制哪些包被 LeakHunter 忽略的属性。 这些属性在默认情况下处于启用状态。 如果注释掉这些属性,代理日志中将报告异常。