尧图网站设计 尧图网站设计YAOTU DESIGN
ARTICLE DETAIL

资讯详情

深耕网站设计与一线实操的经验洞察。

十分钟学会排查线上JVM溢出

十分钟学会排查线上JVM溢出 一:构建内存溢出场景1:构建启动命令设置最大最小内存均为200mb为了快速OOM2:编写坑爹代码package com.dashu.oom.controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.HashMap; import java.util.Map; import java.util.UUID; @RestController @RequestMapping("/testController") public class TestController { private Map map = new HashMap(); @GetMapping("/oom") public String oom(){ for (int i = 0; i 1000000000; i++) { Map temp = new HashMap();
返回列表