`
netcome
  • 浏览: 475635 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

分析AIX上的native内存泄露

    博客分类:
  • AIX
阅读更多

Running native profiling on AIX

Read the information provided

<!-- -->Introduction

AIX provides a debug extension to the malloc subsystem for debugging memory allocation errors and native memory leaks. This extension activates trace points in the malloc routines and records allocations that are not subsequently freed. This tool can be used to identify the source of leaking native memory in the Java process.

<!-- -->Running AIX debug malloc for a Java process

As AIX debug malloc is built into the malloc routines, you do not have to install additional tooling or utilities. To activate AIX debug malloc, set the following environment variable:

    MALLOCDEBUG=[trace,output:malloc.out,report_allocations,verbose,stack_depth:3] 

where the options have the following meanings:

trace Activate tracing of the malloc subsystem.
output Specify tracing to a log file; in this case, malloc.out.
report_allocations Report outstanding allocations when the application stops.
stack_depth Report outstanding allocations with the specified stack depth; in this case, 3.

Notes:

  1. The stack depth of 3 provides only a limited stack trace. However, the use of larger stack depths with a Java application can cause crashes because the debug malloc facility does not understand the stack frames used for JIT compiled code.
  2. Some of these options are available only in AIX 5.3
Because the report provided shows the stack trace for every outstanding allocation, it is often useful to combine entries with the same stack trace and to total the outstanding memory against that stack trace.

The following developerWorks article describes the usage of AIX debug malloc and provides a simple script to combine similar stack traces: http://www.ibm.com/developerworks/aix/library/au-mallocdebug.html?ca=dgr-lnxw82MALLOCDEBUG

<!-- -->Example of AIX debug malloc output

When the Java process stops, a report is written to either stdout or to the specified file, in the following format:

    Allocation #1111: 0x3174BC68 
             Allocation size: 0x400 
             Allocation traceback: 
             0xD02F4370  malloc 
             0x31791258  Java_com_ibm_jtc_demos_LeakyJNIApp_nativeMethod 
             0x301A477C  ?? 
     
         Allocation #1112: 0x3174C078 
             Allocation size: 0x400 
             Allocation traceback: 
             0xD02F4370  malloc 
             0x31791258  Java_com_ibm_jtc_demos_LeakyJNIApp_nativeMethod 
             0x301A477C  ?? 
     
         Allocation #1113: 0x3174C488 
             Allocation size: 0x400 
             Allocation traceback: 
             0xD02F4370  malloc 
             0x31791258  Java_com_ibm_jtc_demos_LeakyJNIApp_nativeMethod 
             0x301A477C  ?? 
     
         Allocation #1114: 0x3174C898 
             Allocation size: 0x400 
             Allocation traceback: 
             0xD02F4370  malloc 
             0x31791258  Java_com_ibm_jtc_demos_LeakyJNIApp_nativeMethod 
             0x301A477C  ?? 
     
         Allocation #1115: 0x3174CCA8 
             Allocation size: 0x400 
             Allocation traceback: 
             0xD02F4370  malloc 
             0x31791258  Java_com_ibm_jtc_demos_LeakyJNIApp_nativeMethod 
             0x301A477C  ?? 
     
         Allocation #1116: 0x3174D0B8 
             Allocation size: 0x400 
             Allocation traceback: 
             0xD02F4370  malloc 
             0x31791258  Java_com_ibm_jtc_demos_LeakyJNIApp_nativeMethod 
             0x301A477C  ?? 
     
         Allocation #1117: 0x3174D4C8 
             Allocation size: 0x400 
             Allocation traceback: 
             0xD02F4370  malloc 
             0x31791258  Java_com_ibm_jtc_demos_LeakyJNIApp_nativeMethod 
             0x301A477C  ?? 

This example shows the allocations made by the Java process that was not freed at the point that the Java processes ended. The Java Virtual Machine itself makes a number of allocations at startup that persist for the lifetime of the JVM and are never freed. Ignore the first 1000 allocations to account for this startup allocation. Any subsequent allocation is a potential leak suspect.

分享到:
评论

相关推荐

    如何检查内存泄露 on AIX

    通过定期收集这些工具的输出,分析内存的增减变化,可以识别出是否存在整体上的内存泄漏现象。 4. 定位具有内存泄漏的单个进程: 结合上述工具,可以通过比较不同时间点进程的内存使用状态,找出内存持续增长的...

    查看Aix进程占用内存大小

    查看Aix进程占用内存大小 内存从大到小排序 CPU占用率从大到小排序 内存从大到小排序(详细执行命令)

    aix内存分配说明详解

    在AIX操作系统中,内存管理对于高性能的应用程序至关重要,尤其是对于使用Java虚拟机(JVM)的程序。本文将深入探讨AIX的内存分配机制,特别是针对32位进程的限制以及如何为JVM堆大小进行优化。 首先,32位AIX进程...

    AIX中Paging_Space使用率过高的分析与解决

    可以使用命令svmon-P-t10-i5每5秒输出一次最耗内存的前10个进程到文件中,然后分析该文件内容以确定内存泄露的应用,从而进行相应的修正或补丁安装。 数据库参数配置对PagingSpace使用率的影响 在安装有数据库的...

    AIX_内存原理.zip_aix_内存原理

    3. **交换空间**:当物理内存不足时,AIX会将不活跃的进程或数据页移动到硬盘上的交换空间,以释放物理内存供其他进程使用。 二、AIX内存类型 1. **用户空间**:这是应用程序可以访问的内存区域,通常不超过2GB。 ...

    AIX 5L 内存性能优化

    AIX 5L 内存性能优化是针对IBM的AIX操作系统进行的一项关键任务,尤其在AIX高手挑战赛中显得尤为重要。AIX Version 5.3引入了多项内存管理的改进,使得管理员能够更有效地调整系统以提高性能。本文将深入探讨内存...

    内存泄露检查工具

    7. MemoryProfiler:对于Python开发者,有一个名为MemoryProfiler的库,可以用来分析Python脚本运行时的内存使用情况,找出可能的内存泄露点。 使用这些工具时,通常需要按照以下步骤进行: 1. 构建项目:首先,...

    AIX dump分析工具

    1. **内存分析**:当Java应用服务器出现异常时,dump文件会包含堆内存快照。分析工具能够解析这些快照,找出内存泄漏、过度分配或其他内存相关问题。 2. **线程分析**:工具可以帮助识别阻塞或挂起的线程,这对于...

    AIX 5L 内存性能优化.txt

    虚拟内存将物理内存与磁盘上的交换空间相结合,提供一个无缝的内存视图。内存管理器负责页面的换入换出,确保关键进程的高效运行。 2. **物理内存分配**: AIX 5L支持多种内存分配策略,如固定分区、动态分区和...

    aix java core 内存分析工具

    从IBM 站点 一个perl 的脚本转过来的。打印内存利用情况。 python 3.0

    AIX 交换分区和内存使用分析

    【AIX 交换分区和内存使用分析】 在AIX操作系统中,内存管理和交换分区的配置对于系统的稳定性和性能至关重要。AIX系统采用虚拟内存技术,允许部分硬盘空间充当内存使用,以解决物理内存不足的问题。这涉及到AIX的...

    AIX内存监控简析

    对AIX内存日常运行监控,分析日志错误监控VMM工作原理,有效预防AIX服务器出现故障

    AIX查看内存 CPU信息

    AIX使用命令行,查看内存 CPU信息,AIX使用命令行,查看内存 CPU信息,

    nmon对linux和AIX系统主流压力测试工具

    - **内存管理**:分析物理内存、虚拟内存和共享内存的分配和使用。 - **磁盘性能**:监控每个硬盘的读写操作,找出I/O瓶颈。 - **网络活动**:追踪网络接口的带宽使用,诊断网络延迟和拥塞。 ### 4. 文件列表详解 ...

    显示AIX内存详细情况

    显示AIX内存使用详细情况, 适用于AIX 4.3 - 7.1

    AIX操作系统内存管理原理

    ### AIX操作系统内存管理原理详解 #### 一、AIX内存管理概述 AIX作为IBM公司的UNIX操作系统之一,在服务器领域有着广泛的应用。其内存管理机制是确保系统稳定性和性能的关键因素之一。本文将深入探讨AIX操作系统的...

Global site tag (gtag.js) - Google Analytics