惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
Netflix TechBlog - Medium
V
Vulnerabilities – Threatpost
Google Online Security Blog
Google Online Security Blog
Hugging Face - Blog
Hugging Face - Blog
L
LINUX DO - 热门话题
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
D
Docker
C
Cyber Attacks, Cyber Crime and Cyber Security
MyScale Blog
MyScale Blog
P
Palo Alto Networks Blog
T
Tenable Blog
P
Privacy International News Feed
Google DeepMind News
Google DeepMind News
小众软件
小众软件
Cisco Talos Blog
Cisco Talos Blog
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
A
Arctic Wolf
C
Cybersecurity and Infrastructure Security Agency CISA
C
Cisco Blogs
T
Threat Research - Cisco Blogs
NISL@THU
NISL@THU
The Hacker News
The Hacker News
Project Zero
Project Zero
AWS News Blog
AWS News Blog
Simon Willison's Weblog
Simon Willison's Weblog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Threatpost
V
Visual Studio Blog
The GitHub Blog
The GitHub Blog
The Cloudflare Blog
Last Week in AI
Last Week in AI
Jina AI
Jina AI
Cyberwarzone
Cyberwarzone
The Register - Security
The Register - Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
Vercel News
Vercel News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
MongoDB | Blog
MongoDB | Blog
U
Unit 42
Scott Helme
Scott Helme
A
About on SuperTechFans
WordPress大学
WordPress大学
F
Fortinet All Blogs
大猫的无限游戏
大猫的无限游戏
G
GRAHAM CLULEY
Latest news
Latest news
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
S
Schneier on Security

博客园 - Johnson_wang

对云服务器挂载cos桶 记录一次xxlJob升级版本导致的 xxl-job remoting error(Connection reset) 记一次NoClassDeffoundEror问题解决过程 nginx配置支持ws,并解决跨域 关于消费端接入dubbo,连接失败问题 RedisTemplate关于key出现前缀\xac\xed\x00\x05t\x00\x0f - Johnson_wang - 博客园 ES 单索引大表拆分 关于ES索引被聚合查询导致filedata堵塞 (pressure too high, (smooth) bulk request circuit break) 发送HTML格式邮件 elasticsearch报错FORBIDDEN/12/index read-only / allow delete spring Boot 相关问题以及修复(后续待补充) mybatis数据加解密处理方案 队列缓存区-db写入 synchronized的实现原理 Scheduler踩坑记录 关于RedisTemplate的map存储踩坑记录 关于HashMap的加载因子相关理解 Mybatis 分页插件PageHelper 遇坑 Linux 下 Mysql忘记密码重置
Eclipse MAT和jvisualvm分析内存溢出
Johnson_wang · 2019-12-09 · via 博客园 - Johnson_wang

---------------------------------------------mac os版------------------------------------------------------

MAT是内存分析工具

1、下载

http://www.eclipse.org/mat/downloads.php

MAC的下载地址

http://www.eclipse.org/downloads/download.php?file=/mat/1.8.1/rcp/MemoryAnalyzer-1.8.1.20180910-macosx.cocoa.x86_64.zip

2、解压后得到

3、运行并指定需要分析的dump文件,得到eclipse试图

4. 核心报表 class histogram

check 是否有超大对象滞留

--------------------------------------------------------------------------------windows----------------------------------------------------------------------------

1、mat 下载地址 https://www.eclipse.org/mat/downloads.php(注意本地jdk是64的就下载64位),下载下来解压就以用,同上macos差不多。

2、 jvisualvm,是jdk自带的,本地的打开本地jdk安装路径  jvisualvm.exe,mac os也可以打开。

****************************************************************重点如下*************************************************************************************

1、场景概述:内存溢出情况,如何定位去分析(Exception in thread "main"java.lang.OutOfMemoryError: Java heap space)

2、配置你的工程jvm启动参数加入重要参数(-XX:+HeapDumpOnOutOfMemoryError),这个参数配置完成后,系统发生OutOfMemoryError发生时自动生成 Heap Dump 文件,

   然后分析dump文件,Java内存使用情况时,往往是在OOM(OutOfMemoryError)发生时。

操作例子如下:

1)创建一个demo工程,加入HeapLeak类

2)然后配置你的vm options参数:-Xms20m -Xmx20m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=D:\opt\HeapLeak.hprof

  开发环境,测试环境,预发布环境,生产环境(可以在jenkins配置,大家可能没有权限)

  

3)运行结果,当出现内存溢出时,会生成dump文件

4)jvisualvm分析文件(可以是.dump结尾的文件也可以是.hprof的文件),查看概要基本信息中会指出oom的异常问题,

会找到你内存溢出的主因,查看如下:

5)mat分析文件,图中指出区域发生内存溢出的区域,点击details可以查看具体oom

补充版:

JProfiler 内存分析

下载地址:https://www.ej-technologies.com/products/jprofiler/overview.html

把dump 根式文件后缀修改为 hprof  并打开

 打开 biggest Object  并且 点检show in graph