
一:构建内存溢出场景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();