1.
2022-01-31 16:07:29.639 ERROR 1981 — [http-nio-8080-exec-4] o.a.c.c.C.[.[.[/].[dispatcherServlet]: Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed; nested exception is java.lang.OutOfMemoryError: Java heap space] with root causejava.lang.OutOfMemoryError: Java heap space2. 内存溢出的问题
3. 场景模拟
// 通过无限创建自定义对象模拟内存溢出的场景@GetMapping(&
2022-01-31 16:07:29.639 ERROR 1981 — [http-nio-8080-exec-4] o.a.c.c.C.[.[.[/].[dispatcherServlet]: Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed; nested exception is java.lang.OutOfMemoryError: Java heap space] with root causejava.lang.OutOfMemoryError: Java heap space4. 分析的方法
java.lang.OutOfMemoryError: Java heap spaceat com.example.demo.entity.CustomObj.<init>(CustomObj.java:11) ~[demo.jar:0.0.1-SNAPSHOT]at com.example.demo.controller.TestController.oom(TestController.java:36) ~[demo.jar:0.0.1-SNAPSHOT]at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
@GetMapping(&
4.2 jmap
jmap -histo pid |head -n 20
jmap -histo:live pid|head -n 20
** * @author liuboren * @Title: 自定义对象 * @Description: 创建该对象用于模拟OOM场景 * @date 2022/1/30 16:55 */public class CustomObj {private int[] numbers = new int[10000000];}
4.3 堆转储文件分析
4.4 arthas
4.5 jstat
jstat -gcutilpid1000
【高级架构师遇到内存溢出问题是怎么解决的?】以上就是朝夕生活(www.30zx.com)关于“高级架构师遇到内存溢出问题是怎么解决的?”的详细内容,希望对大家有所帮助!
猜你喜欢
- 哈弗H6 DHT:香过比亚迪?百公里4个多油的哈弗H6你不看看?
- 什么是内存泄漏,什么是内存溢出,有什么区别
- 内存泄漏和内存溢出的区别和联系,面试必备
- 线上问题解决内存溢出
- 面试官:小伙子你知道几种内存溢出的原因和解决办法
- 魔兽世界:风暴要塞五大极品牌面掉落,骨灰玩家你是不是曾经具有?
- 高手在民间!由玩家创造的十张最精彩卡牌
- 半人马现身巨龙群岛并弃暗投明!魔兽世界10.0众多老脸孔再度相逢
- 企业为何没有基业长青?