当前位置:网站首页>Online - GCeasy GC log analysis tools
Online - GCeasy GC log analysis tools
2022-08-01 10:44:00 【elementary school students learning programming】
1.GCeasy
地址:gceasy
2.Simulate pile out of memory
2.1代码引入
jvm配置
-Xms60m -Xmx60m -XX:SurvivorRatio=8 -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -XX:+PrintHeapAtGC -Xloggc:D:/Desktop/GCLogTest.log
import java.util.ArrayList;
/** * Test generation detailed log file * * -Xms60m -Xmx60m -XX:SurvivorRatio=8 -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -XX:+PrintHeapAtGC */
public class GCLogTest {
public static void main(String[] args) {
ArrayList<byte[]> list = new ArrayList<>();
for (int i = 0; i < 5000; i++) {
byte[] arr = new byte[1024 * 50];//50KB
list.add(arr);
try {
Thread.sleep(30);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
2.2运行代码生成log文件

2.3上传log文件


3.Simulation of yuan space abnormal
3.1代码引入
JVM配置
-Xms60m -Xmx60m -XX:MetaspaceSize=10m -XX:MaxMetaspaceSize=10m -XX:SurvivorRatio=8 -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -XX:+PrintHeapAtGC -Xloggc:D:/Desktop/MetaspaceOOM.log
import com.sun.xml.internal.ws.org.objectweb.asm.ClassWriter;
import jdk.internal.org.objectweb.asm.Opcodes;
/** * java.lang.OutOfMemoryError: Metaspace异常演示: * * -Xms60m -Xmx60m -XX:MetaspaceSize=10m -XX:MaxMetaspaceSize=10m -XX:SurvivorRatio=8 -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -XX:+PrintHeapAtGC * */
public class MetaspaceOOM extends ClassLoader {
public static void main(String[] args) {
int j = 0;
try {
MetaspaceOOM test = new MetaspaceOOM();
for (int i = 0; i < 10000; i++) {
//创建ClassWriter对象,用于生成类的二进制字节码
ClassWriter classWriter = new ClassWriter(0);
//指明版本号,修饰符,类名,包名,父类,接口
classWriter.visit(Opcodes.V1_8, Opcodes.ACC_PUBLIC, "Class" + i, null, "java/lang/Object", null);
//返回byte[]
byte[] code = classWriter.toByteArray();
//类的加载
test.defineClass("Class" + i, code, 0, code.length);//Class对象
j++;
}
} finally {
System.out.println(j);
}
}
}
3.2运行代码生成log文件

3.3上传log文件

边栏推荐
- 记一次 .NET 某智慧物流WCS系统CPU爆高分析
- RK3399平台开发系列讲解(内核入门篇)1.52、printk函数分析 - 其函数调用时候会关闭中断
- Browser shortcut keys
- 如何解决 chrome 浏览器标签过多无法查看到标题的情况
- ClickHouse多种安装方式
- Promise学习(二)一篇文章带你快速了解Promise中的常用API
- AI篮球裁判火了,走步算得特别准,就问哈登慌不慌
- STM32入门开发 介绍IIC总线、读写AT24C02(EEPROM)(采用模拟时序)
- Introduction to data warehouse layering (real-time data warehouse architecture)
- How to Steal $100 Million from the Perfect Smart Contract
猜你喜欢
随机推荐
shell--面试题
slice、splice、split傻傻分不清
解决new Thread().Start导致高并发CPU 100%的问题
石头科技打造硬核品牌力 持续出海拓展全球市场
什么是步进电机?40张图带你了解!
CTFshow,命令执行:web32
ClickHouse多种安装方式
回归预测 | MATLAB实现TPA-LSTM(时间注意力注意力机制长短期记忆神经网络)多输入单输出
记一次 .NET 某智慧物流WCS系统CPU爆高分析
Solve vscode input! Unable to quickly generate skeletons (three methods for the new version of vscode to quickly generate skeletons)
JWT
Mini Program Graduation Works WeChat Food Recipes Mini Program Graduation Design Finished Products (2) Mini Program Functions
在线GC日志分析工具——GCeasy
回归预测 | MATLAB实现RNN循环神经网络多输入单输出数据预测
微信公众号授权登录后报redirect_uri参数错误的问题
Promise学习(三)Promise的几个关键性问题 -- 状态改变、执行顺序与机制、多任务串联、异常穿透、中断promise链
编码解码(btoa、encodeURIComponent、encodeURI、escape)
还在纠结报表工具的选型么?来看看这个
retired paddling
Android 安全与防护策略









