[转帖]Batch mode

batch,mode · 浏览次数 : 0

小编点评

**Memory Analyzer Batch Mode Guide** **Overview** Memory Analyzer allows batch mode processing of heap dumps to analyze memory usage on multiple systems. This guide provides a comprehensive overview of the batch mode workflow, including command-line options, report generation, and other settings. **Command-Line Options** * **-keep_unreachable_objects**: Keep only reachable objects in the heap dump index. * **-remove_unreachable_objects**: Remove all unreachable objects from the index. * **-test_overview**: Test the "Heap Dump Overview" section of the results report. * **-test_problem_suspects**: Perform tests on suspicious objects in the results report. * **-generate_report**: Generate a comprehensive HTML report with detailed analysis. * **-output_directory**: Specify the output directory for the report. * **-results_file**: Specify the output file name for the results report. **Report Generation** The results are generated in an HTML report file named "myheapdump_Leak_Suspects.zip". The report includes the following sections: * **Heap Dump Overview** * **Problem Suspect Analysis** * **All Accumulated Objects by Class** **Additional Settings** * **-depth**: Specify the depth of the dominator tree for testing. * **-threshold**: Set a memory threshold for identifying suspect objects. **Example Command** ``` memory_analyzer --keep_unreachable_objects --test_problem_suspects --generate_report --output_directory=results --results_file=myheapdump_Leak_Suspects.zip ``` **Tips for Best Results** * Use a clean and isolated test environment. * Ensure that the heap dumps are valid and contain representative objects. * Select appropriate threshold values for detecting suspicious objects. * Run multiple test cases to validate the results. **Conclusion** Batch mode in Memory Analyzer provides a powerful tool for comprehensive memory analysis and troubleshooting. By understanding the command-line options and report generation settings, you can customize the analysis to meet your specific requirements.

正文

https://help.eclipse.org/latest/index.jsp?topic=%2Forg.eclipse.mat.ui.help%2Ftasks%2Fbatch.html&cp%3D54_3_14

 

Memory Analyzer can be operated in batch mode to process heap dumps without user input.

  1. Note: On Windows, use .\mat\ParseHeapDump.bat instead of ./mat/ParseHeapDump.sh
    Run ./mat/ParseHeapDump.sh myheapdump.hprof org.eclipse.mat.api:suspects
    • For a simple suspects report use org.eclipse.mat.api:suspects See running leak suspect report for more details.
    • For an overview report use org.eclipse.mat.api:overview This report is included at the beginning of the leak suspects report and shows:
      • Heap Dump Overview
      • System Properties
      • Thread Overview
      • Top Consumers
      • Class Histogram
    • For a report on memory usage by component use org.eclipse.mat.api:top_components See Component report for more details of the report run on each of the top components by memory usage.
    • To compare two heap dumps use ./mat/ParseHeapDump.sh myheapdump.hprof -snapshot2=myheapdump2.hprof org.eclipse.mat.api:compare
    • To compare two heap dumps for memory leaks with a leak suspects report use ./mat/ParseHeapDump.sh myheapdump.hprof -baseline=myheapdump2.hprof org.eclipse.mat.api:suspects2 See running leak suspect report by snapshot comparison for more details.
    • To export a new copy of the heap dump with redactions use a command like
      
      ./mat/ParseHeapDump.sh
      myheapdump.hprof
      -output=myheapdump2.hprof
      -redact=BASIC
      -map=myheapdump2.map
      org.eclipse.mat.hprof:export
      					
      See export heap dump for more details.
    • To run a single query on a heap dump and produce an HTML report use ./mat/ParseHeapDump.sh myheapdump.hprof -command=histogram org.eclipse.mat.api:query See Query Report for more details.
  2. Choose additional options to control the parse and report generation.
    Command line options controlling the parse.
    1. -keep_unreachable_objects means that all objects are retained in the snapshot, even if they are not reachable from an ordinary GC root.
    2. -snapshot_identifier=identifier Selects one snapshot when there is the choice of several in the heap dump file. For HPROF files this might be of the form #1 or #2. For DTFJ system dump files this might be of the form Address space ID.Process ID.Runtime ID. If there are multiple snapshots in a heap dump file and a specific snapshot is not selected then the parse will fail with a org.eclipse.mat.snapshot.MultipleSnapshotsException which will list appropriate possible snapshot identifiers to use with this option.
    3. Note: Experimental
      -discard_ratio=percentage. Option to discard a fraction of the objects from huge dumps.
      See discard configuration for an explanation of these discard options.
    4. Note: Experimental
      -discard_pattern=regex. A regular expression matching the class names of objects to be discarded.
    5. Note: Experimental
      -discard_offset=offset value. Controls which particular objects are discarded.
    6. Note: Experimental
      -discard_seed=random number generator seed. Controls which particular objects are discarded.
    7. Other report options

      Other parameters controlling output include the following:

      ArgumentDescription
      -limit=number of entries Controls the number of entries generated in an output table. See org.eclipse.mat.report.Params.Rendering.LIMIT
      -format=type of output Controls the type of the output (HTML, CSV, or TXT). See org.eclipse.mat.report.Params.FORMAT
      -html.show_table_headings Controls whether table headings should be shown for tables. See org.eclipse.mat.report.Params.Html.SHOW_TABLE_HEADER
      -html.show_totals Controls whether totals should be shown for tables. See org.eclipse.mat.report.Params.Html.SHOW_TOTALS
    Task: Parsing myheapdump.hprof
    [Task: Parsing .\Downloads\myheapdump.hprof
    [
    Subtask: Scanning .\Downloads\myheapdump.hprof
    [.................
    [INFO] Detected compressed references, because with uncompressed 64-bit references the array at 0x5c4bd4258 would overlap the array at 0x5c4bd4230
    [....................
    [INFO] Wrote threads call stacks to .\Downloads\myheapdump.threads
    [....................
    [INFO] Heap .\Downloads\myheapdump.hprof contains 116,716 objects
    [....................
    Subtask: Extracting objects from .\Downloads\myheapdump.hprof
    [...................................................................................Task: Removing unreachable objects
    [
    Subtask: Searching for unreachable objects
    [
    Subtask: Marking reachable objects
    [.
    Subtask: Re-indexing objects
    [..
    Subtask: Re-indexing classes
    [...
    Subtask: Writing .\Downloads\myheapdump.idx.index
    [....
    Subtask: Writing .\Downloads\myheapdump.o2c.index
    [.....
    Subtask: Writing .\Downloads\myheapdump.a2s.index
    [......
    Subtask: Re-indexing outbound index
    [.......
    Subtask: Writing .\Downloads\myheapdump.inbound.index
    [........
    Subtask: Writing .\Downloads\myheapdump.outbound.index
    [.........
    Subtask: Writing .\Downloads\myheapdump.o2hprof.index
    [.........Task: Calculating Dominator Tree
    [
    Subtask: Dominator Tree calculation
    [
    Subtask: Depth-first search
    [....................
    Subtask: Computing dominators
    [..............................................
    Subtask: Calculate retained sizes
    [............................................................
    Subtask: Create dominators index file
    [................................................................................]
    
    Subtask: Test 'Heap Dump Overview' of section 'System Overview'
    [
    Subtask: Test 'System Properties' of section 'System Overview'
    [
    Subtask: Extracting Key Value Pairs...
    [
    Subtask: Test 'Thread Overview' of section 'System Overview'
    [
    Subtask: Searching Threads...
    [
    Subtask: Test 'Top Consumers' of section 'System Overview'
    [
    Subtask: Creating histogram
    [
    Subtask: Grouping by package
    [
    Subtask: Test 'Biggest Objects (Overview)' of section 'Top Consumers'
    [
    Subtask: Test 'Biggest Objects' of section 'Top Consumers'
    [
    Subtask: Test 'Biggest Top-Level Dominator Classes (Overview)' of section 'Top Consumers'
    [
    Subtask: Test 'Biggest Top-Level Dominator Classes' of section 'Top Consumers'
    [
    Subtask: Test 'Biggest Top-Level Dominator Class Loaders (Overview)' of section 'Top Consumers'
    [
    Subtask: Test 'Biggest Top-Level Dominator Class Loaders' of section 'Top Consumers'
    [
    Subtask: Test 'Biggest Top-Level Dominator Packages' of section 'Top Consumers'
    [
    Subtask: Test 'Class Histogram' of section 'System Overview'
    [
    Subtask: Test 'Leaks' of section 'Leak Suspects'
    [
    Subtask: Finding problem suspects
    [
    Subtask: Searching suspicious single objects ...
    [
    Subtask: Searching suspicious groups of objects ...
    [
    Subtask: building histogram
    [
    Subtask: Preparing results
    [
    Subtask: building histogram
    [
    Subtask: building histogram
    [
    Subtask: Finding paths
    [
    Subtask: Test 'Overview' of section 'Leaks'
    [
    Subtask: Test 'Problem Suspect 1' of section 'Leaks'
    [
    Subtask: Test 'Description' of section 'Problem Suspect 1'
    [
    Subtask: Test 'Shortest Paths To the Accumulation Point' of section 'Problem Suspect 1'
    [
    Subtask: Test 'Shortest Paths To the Accumulation Point' of section 'Problem Suspect 1'
    [
    Subtask: Test 'Accumulated Objects in Dominator Tree' of section 'Problem Suspect 1'
    [
    Subtask: Test 'Accumulated Objects in Dominator Tree' of section 'Problem Suspect 1'
    [
    Subtask: Test 'Accumulated Objects by Class in Dominator Tree' of section 'Problem Suspect 1'
    [
    Subtask: Test 'Accumulated Objects by Class in Dominator Tree' of section 'Problem Suspect 1'
    [
    Subtask: Test 'All Accumulated Objects by Class' of section 'Problem Suspect 1'
    [
    Subtask: Test 'All Accumulated Objects by Class' of section 'Problem Suspect 1'
    []
    					
  3. Unzip the report myheapdump_Leak_Suspects.zip
  4. View the index.html

The result is a HTML report.

与[转帖]Batch mode相似的内容:

[转帖]Batch mode

https://help.eclipse.org/latest/index.jsp?topic=%2Forg.eclipse.mat.ui.help%2Ftasks%2Fbatch.html&cp%3D54_3_14 Memory Analyzer can be operated in batch

[转帖]

Linux ubuntu20.04 网络配置(图文教程) 因为我是刚装好的最小系统,所以很多东西都没有,在开始配置之前需要做下准备 环境准备 系统:ubuntu20.04网卡:双网卡 网卡一:供连接互联网使用网卡二:供连接内网使用(看情况,如果一张网卡足够,没必要做第二张网卡) 工具: net-to

[转帖]

https://cloud.tencent.com/developer/article/2168105?areaSource=104001.13&traceId=zcVNsKTUApF9rNJSkcCbB 前言 Redis作为高性能的内存数据库,在大数据量的情况下也会遇到性能瓶颈,日常开发中只有时刻

[转帖]ISV 、OSV、 SIG 概念

ISV 、OSV、 SIG 概念 2022-10-14 12:29530原创大杂烩 本文链接:https://www.cndba.cn/dave/article/108699 1. ISV: Independent Software Vendors “独立软件开发商”,特指专门从事软件的开发、生产、

[转帖]Redis 7 参数 修改 说明

2022-06-16 14:491800原创Redis 本文链接:https://www.cndba.cn/dave/article/108066 在之前的博客我们介绍了Redis 7 的安装和配置,如下: Linux 7.8 平台 Redis 7 安装并配置开机自启动 操作手册https://ww

[转帖]HTTPS中间人攻击原理

https://www.zhihu.com/people/bei-ji-85/posts 背景 前一段时间,公司北京地区上线了一个HTTPS防火墙,用来监听HTTPS流量。防火墙上线之前,邮件通知给管理层,我从我老大那里听说这个事情的时候,说这个有风险,然后意外地发现,很多人原来都不知道HTTPS防

[转帖]关于字节序(大小端)的一点想法

https://www.zhihu.com/people/bei-ji-85/posts 今天在一个技术群里有人问起来了,当时有一些讨论(不完全都是我个人的观点),整理一下: 为什么网络字节序(多数情况下)是大端? 早年设备的缓存很小,先接收高字节能快速的判断报文信息:包长度(需要准备多大缓存)、地

[转帖]awk提取某一行某一列的数据

https://www.jianshu.com/p/dbcb7fe2da56 1、提取文件中第1列数据 awk '{print $1}' filename > out.txt 2、提取前2列的文件 awk `{print $1,$2}' filename > out.txt 3、打印完第一列,然后打

[转帖]awk 中 FS的用法

https://www.cnblogs.com/rohens-hbg/p/5510890.html 在openwrt文件 ar71xx.sh中 查询设备类型时,有这么一句, machine=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /machine/ {print $2}' /

[转帖]Windows Server 2022 简体中文版、英文版下载 (updated Oct 2022)

https://sysin.org/blog/windows-server-2022/ Windows Server 2022 正式版,2022 年 10 月更新,VLSC Posted by sysin on 2022-10-27 Estimated Reading Time 8 Minutes