当前位置:网站首页>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文件
边栏推荐
- C语言实现!20000用4秒计算
- 什么是步进电机?40张图带你了解!
- The meaning and trigger conditions of gc
- Promise learning (1) What is Promise?how to use?How to solve callback hell?
- 回归预测 | MATLAB实现TPA-LSTM(时间注意力注意力机制长短期记忆神经网络)多输入单输出
- What is a stepper motor?40 pictures to show you!
- 从零开始Blazor Server(4)--登录系统
- [Software Architecture Mode] The difference between MVVM mode and MVC mode
- Mini Program Graduation Works WeChat Food Recipes Mini Program Graduation Design Finished Products (2) Mini Program Functions
- 小程序毕设作品之微信美食菜谱小程序毕业设计成品(4)开题报告
猜你喜欢
复现assert和eval成功连接或失败连接蚁剑的原因
如何解决 chrome 浏览器标签过多无法查看到标题的情况
Message queue interview latest finishing (2022)
CTFshow,命令执行:web31
CTO strongly banning the use of the Calendar, that in what?
2022年中盘点 | 产品打底,科技背书,广汽集团阔步向前
Mini Program Graduation Works WeChat Food Recipes Mini Program Graduation Design Finished Products (3) Background Functions
Google Earth Engine APP——15行代码搞定一个inspector高程监测APP
记一次 .NET 某智慧物流WCS系统CPU爆高分析
在线GC日志分析工具——GCeasy
随机推荐
PDMan-国产免费通用数据库建模工具(极简,漂亮)
InputStream转成String
Endorsed in 2022 years inventory | product base, science and technology, guangzhou automobile group striding forward
Generate certificates using KeyStore
Promise learning (1) What is Promise?how to use?How to solve callback hell?
CTFshow,命令执行:web31
MFC implementation road map navigation system
Dataset之mpg:mpg数据集的简介、下载、使用方法之详细攻略
Promise学习(四)异步编程的终极解决方案async + await:用同步的方式去写异步代码
ClickHouse入门介绍与其特性
CTFshow,命令执行:web37
CTFshow,命令执行:web33
C语言程序设计50例(三)(经典收藏)
2022年中盘点 | 产品打底,科技背书,广汽集团阔步向前
Promise学习(三)Promise的几个关键性问题 -- 状态改变、执行顺序与机制、多任务串联、异常穿透、中断promise链
怎么找出电脑隐藏的软件(如何清理电脑隐藏软件)
将本地项目推送到远程仓库
Google Earth Engine——给影像添加一个属性对于单景的时间序列并返回影像
Visualization - Superset installation and deployment
Enterprise WeChat group: robot timing reminder function database configuration