性能测试-jvm

1、jps: 查看java进程

复制代码
[root@VM-100-3-centos ~]# jps
7088 Jps
1521 ruoyi-admin.jar
3978 sys_perf_01-0.0.1-SNAPSHOT.jar
[root@VM-100-3-centos ~]# 

2、jmap: 查看java内存

复制代码
[root@VM-100-3-centos ~]# jmap -heap 3978
Attaching to process ID 3978, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.381-b09

using thread-local object allocation.
Parallel GC with 4 thread(s)

Heap Configuration:
   MinHeapFreeRatio         = 0
   MaxHeapFreeRatio         = 100
   MaxHeapSize              = 1258291200 (1200.0MB)
   NewSize                  = 42467328 (40.5MB)
   MaxNewSize               = 419430400 (400.0MB)
   OldSize                  = 85458944 (81.5MB)
   NewRatio                 = 2
   SurvivorRatio            = 8
   MetaspaceSize            = 21807104 (20.796875MB)
   CompressedClassSpaceSize = 1073741824 (1024.0MB)
   MaxMetaspaceSize         = 17592186044415 MB
   G1HeapRegionSize         = 0 (0.0MB)

Heap Usage:
PS Young Generation
Eden Space:
   capacity = 191365120 (182.5MB)
   used     = 76968480 (73.40286254882812MB)
   free     = 114396640 (109.09713745117188MB)
   40.220746602097606% used
From Space:
   capacity = 7864320 (7.5MB)
   used     = 7667760 (7.3125457763671875MB)
   free     = 196560 (0.1874542236328125MB)
   97.5006103515625% used
To Space:
   capacity = 11534336 (11.0MB)
   used     = 0 (0.0MB)
   free     = 11534336 (11.0MB)
   0.0% used
PS Old Generation
   capacity = 63438848 (60.5MB)
   used     = 11229000 (10.708808898925781MB)
   free     = 52209848 (49.79119110107422MB)
   17.70051057673683% used

13102 interned Strings occupying 1125712 bytes.
[root@VM-100-3-centos ~]# 

可以看到最大堆内存:MaxHeapSize = 1258291200 (1200.0MB)

这个数值是启动该java 服务时设置的最大内存,如下所示:

复制代码
java -Xmx1200m -Dserver.port=18001 -jar sys_perf_01-0.0.1-SNAPSHOT.jar 
相关推荐
用户84913717547166 小时前
生产级故障排查实战:从制造 OOM 到 IDEA Profiler 深度破案
java·jvm
爱学java的ptt8 小时前
jvm笔记
jvm·笔记
DKPT1 天前
ZGC和G1收集器相比哪个更好?
java·jvm·笔记·学习·spring
低客的黑调1 天前
为你的项目选择一个适合的[垃圾收集器]
java·jvm·算法
xu_yule1 天前
Linux_14(多线程)线程控制+C++多线程
java·开发语言·jvm
豆奶特浓61 天前
Java面试生死局:谢飞机遭遇在线教育场景,从JVM、Spring Security到AI Agent,他能飞吗?
java·jvm·微服务·ai·面试·spring security·分布式事务
Boop_wu1 天前
[Java EE] 多线程进阶(JUC)(2)
java·jvm·算法
3***31211 天前
java进阶1——JVM
java·开发语言·jvm
打工人你好3 天前
如何设计更安全的 VIP 权限体系
java·jvm·安全
unclecss3 天前
把 Spring Boot 的启动时间从 3 秒打到 30 毫秒,内存砍掉 80%,让 Java 在 Serverless 时代横着走
java·jvm·spring boot·serverless·graalvm