JDK学习篇

工具命令

java

java [options] -jar filename [args]

options

# -Xmx : Sets the maximum size (in byes) of the memory allocation pool,The -Xmx option is equivalent to -XX:MaxHeapSize.
java -Xmx80M

# -Xmx : Sets the minimum and the initial size (in bytes) of the heap,the -XX:InitalHeapSize option can also be used to set the initial heap size
java -Xms80M

#Sets a system property value
java -Dproperty=value

args

The arguments passed to the main() method separated by spaces

javaw

launch a Java application without a console window(Windows Only),The javaw command is identical to java, except that with javaw there’s no associated console window

jps

list the instrumented JVMs on the target system,可用于获取每个java进程id
options:

  • -l displays the full package name for the application’s main class or the full path name to the application’s JAR file.
jsp -l

jstack

print Java stack traces of Java threads for a specified Java process
options:

  • -l long listing. Prints additional information about locks
  • -e extended listing. Prints additional information about threads,allocated字段为每个线程被分配的内存量
  • -? -h --help -help to print this help message
jstack -l -e <pid>

名词解释

heap

The Java Virtual Machine has a heap that is shared among all Java Virtual Machine
threads. The heap is the run-time data area from which memory for all class
instances and arrays is allocated.
The heap is created on virtual machine start-up. Heap storage for objects is
reclaimed by an automatic storage management system (known as a garbage
collector); objects are never explicitly deallocated.

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值