ClassLoader—观察程序运行时类加载的过程-verbose:class

本文介绍如何利用-verbose命令进行Java程序调试,包括查看加载的类、内存回收及本地方法调用情况。通过MyEclipse配置或命令行方式启用-verbose功能,帮助开发者深入了解程序运行状态。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在调试程序时,有时需要查看程序加载的类、内存回收情况、调用的本地接口等。这时候就需要-verbose命令。在myeclipse可以通过右键设置(如下),也可以在命令行输入java -verbose来查看。

-verbose:class

在空白处右键



选择Run Configurations



点击Run运行,在控制台即可看到所有被虚拟机加载的类;


在虚拟机参数中输入“-verbose:class”


-verbose:gc


查看虚拟机中内存回收情况



-verbose:jni

查看本地方法调用的情况



PS F:\workdata\115_project> mvn dependency:tree | findstr "security" [INFO] +- org.springframework.boot:spring-boot-starter-security:jar:3.3.5:compile [INFO] | +- org.springframework.security:spring-security-config:jar:6.3.4:compile [INFO] | | \- org.springframework.security:spring-security-core:jar:6.3.4:compile [INFO] | | \- org.springframework.security:spring-security-crypto:jar:6.3.4:compile [INFO] | \- org.springframework.security:spring-security-web:jar:6.3.4:compile [INFO] | +- org.springframework.boot:spring-boot-starter-security:jar:3.3.5:compile [INFO] | | +- org.springframework.security:spring-security-config:jar:6.3.4:compile [INFO] | | | \- org.springframework.security:spring-security-core:jar:6.3.4:compile [INFO] | | | \- org.springframework.security:spring-security-crypto:jar:6.3.4:compile [INFO] | | \- org.springframework.security:spring-security-web:jar:6.3.4:compile [INFO] | +- org.springframework.boot:spring-boot-starter-security:jar:3.3.5:compile [INFO] | | +- org.springframework.security:spring-security-config:jar:6.3.4:compile [INFO] | | | \- org.springframework.security:spring-security-crypto:jar:6.3.4:compile [INFO] | | \- org.springframework.security:spring-security-web:jar:6.3.4:compile Downloading from public: https://maven.aliyun.com/repository/public/org/eclipse/jetty/jetty-security/12.0.14/jetty-security-12.0.14.pom Downloaded from public: https://maven.aliyun.com/repository/public/org/eclipse/jetty/jetty-security/12.0.14/jetty-security-12.0.14.pom (5.2 kB at 26 kB/s) [INFO] | +- org.springframework.boot:spring-boot-starter-security:jar:3.3.5:compile [INFO] | | +- org.springframework.security:spring-security-config:jar:6.3.4:compile [INFO] | | \- org.springframework.security:spring-security-web:jar:6.3.4:compile [INFO] | | +- org.springframework.security:spring-security-core:jar:6.3.4:compile [INFO] | +- org.eclipse.jetty:jetty-security:jar:12.0.14:compile [INFO] | | +- org.springframework.boot:spring-boot-starter-security:jar:3.3.5:compile [INFO] | | | +- org.springframework.security:spring-security-config:jar:6.3.4:compile [INFO] | | | \- org.springframework.security:spring-security-web:jar:6.3.4:compile [INFO] | | +- org.springframework.security:spring-security-core:jar:6.3.4:compile [INFO] | +- org.eclipse.jetty:jetty-security:jar:12.0.14:compile PS F:\workdata\115_project>
最新发布
07-26
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值