当前位置:网站首页>什么是内存溢出
什么是内存溢出
2022-07-17 08:00:00 【y_bccl27】
内存溢出(Out Of Memory)是指JVM可用内存不足。JVM运行需要使用的内存超出最大可用值,会导致JVM出现异常。常见的OOM有以下几种:
栈溢出
堆溢出
方法区溢出
本机直接内存溢出
1.栈溢出
/**
* 栈溢出
*/
public class StackOverFlow {
static int count;
//方法运行一次,往虚拟机栈压入一个栈帧
private static void king() {
count++;
king();
}
public static void main(String[] args) throws Throwable {
try {
king();
} catch (Throwable throwable) {
System.out.println("count:"+count);
throwable.printStackTrace();
}
}
}在IDEA开发工具中,设置栈的大小1MB:
-Xss1m
边栏推荐
- Address monitoring API: how to trace and monitor uniswap hacker addresses
- MySQL data type
- ROS常用工具包命令
- Gateway new generation gateway
- Yyds dry inventory cross origin cross domain request
- OpenCV极坐标转换函数warpPolar的使用
- Redis6 new data type geospatial
- Demo collection injection
- Solution to sudo PIP install gevent installation failure
- OpenFeign服务接口调用
猜你喜欢
随机推荐
65. Restful specification
No module named ‘yaml‘ 解决办法
Viewing the technology stack of distributed system from the crash report of station B
Finishing of key concepts on deep neural networks exercises in the fourth week of in-depth learning
结构体和联合体的区别与联系
Ribbon load balancing service call
Redis常用数据类型——哈希(Hash)和有序集合 Zset(sorted set)
Sorting out of neural network basics exercises in the second week of in-depth study
超干货!彻底搞懂Golang内存管理和垃圾回收
Super dry! Thoroughly understand golang memory management and garbage collection
JS学习笔记09-12:原型对象以及Foreach+tostring及回收站
JS study note 04-05 - modification of constructor and creation using factory method
RestTemplate
1. Flask Foundation
Openpyxl copy sheet pages across workbooks
be vigilant! Another phishing attack: uniswap stolen $8.1 million
Eureka self protection
JS learning notes 09-12: prototype objects, foreach+tostring and recycle bin
Unity: window size adaptation when running on the browser after webgl Publishing
力扣382链表随机节点笔记









