当前位置:网站首页>[efficiency optimization] Nani? Memory overflow again?! It's time to sum up the wave!!

[efficiency optimization] Nani? Memory overflow again?! It's time to sum up the wave!!

2020-11-06 01:35:00 itread01

## Write it at the front > I believe that in the process of daily work , More or less, there will be a scene : Memory overflow . If you haven't come across this scene , That means you're a fake programmer . ha-ha , Make a joke , In the ordinary course of work , We do have this problem . today , I will usually work in the process of memory overflow to do a simple summary , In the form of easy to understand code cases, intuitive to share with you . Hope to be able to bring substantial help to the small partners . ## Case introduction Here , The memory overflow situation that I will summarize in the course of my daily work , In the form of code cases, intuitive sharing to you , Hope to be able to bring substantial help to the small partners . Next , We will analyze various memory overflow situations in the form of code cases . ## Define the main class structure First , We create a class called BlowUpJVM, All the case studies are based on this class . ```java public class BlowUpJVM { } ``` ## Stack depth overflow ```java public static void testStackOverFlow(){ BlowUpJVM.testStackOverFlow(); } ``` The stack goes back and forth , And it didn't deal with , So the virtual machine stack goes deeper and deeper , The stack depth just overflows . ## Permanent generation memory overflow ```java public static void testPergemOutOfMemory1(){ // Method one failed

版权声明
本文为[itread01]所创,转载请带上原文链接,感谢