JVM 参数学习

Comsol超声空化气泡仿真入门:从零搭建模型到网格划分的完整流程 本文详细介绍了使用Comsol进行超声空化气泡仿真的完整流程,从物理基础理解到模型搭建、网格划分及求解器设置。通过具体步骤和示例代码,帮助初学者和工程师快速掌握这一关键技术,应用于医疗设备和工业清洗等领域。 阅读详情

JAVA 命令参数选项含义

参考资料:Oracle官网 java 命令

Options

java [options] classname [args]
java [options] -jar filename [args]

java 命令支持的选项,大致分为四类:

  • 标准参数 Standard Options(- or -D)
  • 非标准参数 Non-Standard Options(-X)
  • 运行时定制参数(高级选项) Advanced Runtime Options(-XX)
  • Advanced JIT Compiler Options
  • Advanced Serviceability Options
  • Advanced Garbage Collection Options

Boolean options 布尔选项:用于 -XX options:
加号代表启用 (-XX:+OptionName);
减号代表禁用 (-XX:-OptionName);

Standard Options

These are the most commonly used options that are supported by all implementations of the JVM.

-Dproperty=value
-jar filename
-jre-restrict-search

Includes user-private JREs in the version search.

-server

Selects the Java HotSpot Server VM. The 64-bit version of the JDK supports only the Server VM, so in that case the option is implicit.

Non-Standard Options

These options are general purpose options that are specific to the Java HotSpot Virtual Machine.

-X

-Xloggc:filename

Sets the file to which verbose GC events information should be redirected for logging. The information written to this file is similar to the output of -verbose:gc with the time elapsed since the first GC event preceding each logged event. The -Xloggc option overrides -verbose:gc if both are given with the same java command.

-Xmnsize

Sets the initial and maximum size (in bytes) of the heap for the young generation (nursery). Append the letter k or K to indicate kilobytes, m or M to indicate megabytes, g or G to indicate gigabytes.

-Xmssize

Sets the minimum and the initial size (in bytes) of the heap. This value must be a multiple of 1024 and greater than 1 MB. Append the letter k or K to indicate kilobytes, m or M to indicate megabytes, g or G to indicate gigabytes.

-Xmxsize

Specifies the maximum size (in bytes) of the memory allocation pool in bytes. This value must be a multiple of 1024 and greater than 2 MB. Append the letter k or K to indicate kilobytes, m or M to indicate megabytes, g or G to indicate gigabytes. The default value is chosen at runtime based on system configuration. For server deployments, -Xms and -Xmx are often set to the same value.

-Xsssize

Sets the thread stack size (in bytes). Append the letter k or K to indicate KB, m or M to indicate MB, g or G to indicate GB. The default value depends on virtual memory.

Advanced Runtime Options

These options control the runtime behavior of the Java HotSpot VM.

-XX

-XX:ErrorFile=filename

Specifies the path and file name to which error data is written when an irrecoverable error occurs. By default, this file is created in the current working directory and named hs_err_pidpid.log where pid is the identifier of the process that caused the error. The following example shows how to set the default log file (note that the identifier of the process is specified as %p):

Advanced JIT Compiler Options

These options control the dynamic just-in-time (JIT) compilation performed by the Java HotSpot VM.

-XX:AllocatePrefetchDistance=size

Sets the size (in bytes) of the prefetch distance for object allocation. Memory about to be written with the value of new objects is prefetched up to this distance starting from the address of the last allocated object. Each Java thread has its own allocation point. Negative values denote that prefetch distance is chosen based on the platform. Positive values are bytes to prefetch. Append the letter k or K to indicate kilobytes, m or M to indicate megabytes, g or G to indicate gigabytes. The default value is set to -1.

Advanced Serviceability Options

These options provide the ability to gather system information and perform extensive debugging.

-XX:+HeapDumpOnOutOfMemoryError

Enables the dumping of the Java heap to a file in the current directory by using the heap profiler (HPROF) when a java.lang.OutOfMemoryError exception is thrown. You can explicitly set the heap dump file path and name using the -XX:HeapDumpPath option. By default, this option is disabled and the heap is not dumped when an OutOfMemoryError exception is thrown.

-XX:HeapDumpPath=path

Sets the path and file name for writing the heap dump provided by the heap profiler (HPROF) when the -XX:+HeapDumpOnOutOfMemoryError option is set. By default, the file is created in the current working directory, and it is named java_pidpid.hprof where pid is the identifier of the process that caused the error.

-XX:LogFile=path

Sets the path and file name where log data is written. By default, the file is created in the current working directory, and it is named hotspot.log.

Advanced Garbage Collection Options

These options control how garbage collection (GC) is performed by the Java HotSpot VM.

-XX:ActiveProcessorCount=x

Overrides the number of CPUs that the VM uses to calculate the size of thread pools it uses for various operations such as Garbage Collection and ForkJoinPool. The VM normally determines the number of available processors from the operating system. This flag can be useful for partitioning CPU resources when running multiple Java processes in docker containers. This flag is honored even if UseContainerSupport is not enabled. See -XX:-UseContainerSupport for a description of enabling and disabling container support.

-XX:MaxHeapSize=size

Sets the maximum size (in byes) of the memory allocation pool. This value must be a multiple of 1024 and greater than 2 MB. Append the letter k or K to indicate kilobytes, m or M to indicate megabytes, g or G to indicate gigabytes. The default value is chosen at runtime based on system configuration. For server deployments, -XX:InitialHeapSize and -XX:MaxHeapSize are often set to the same value.

-XX:G1HeapRegionSize=size

Sets the size of the regions into which the Java heap is subdivided when using the garbage-first (G1) collector. The value can be between 1 MB and 32 MB. The default region size is determined ergonomically based on the heap size.

-XX:InitialHeapSize=size

Sets the initial size (in bytes) of the memory allocation pool. This value must be either 0, or a multiple of 1024 and greater than 1 MB. Append the letter k or K to indicate kilobytes, m or M to indicate megabytes, g or G to indicate gigabytes. The default value is chosen at runtime based on system configuration.

-XX:InitialSurvivorRatio=ratio

Sets the initial survivor space ratio used by the throughput garbage collector (which is enabled by the -XX:+UseParallelGC and/or -XX:+UseParallelOldGC options). Adaptive sizing is enabled by default with the throughput garbage collector by using the -XX:+UseParallelGC and -XX:+UseParallelOldGC options, and survivor space is resized according to the application behavior, starting with the initial value. If adaptive sizing is disabled (using the -XX:-UseAdaptiveSizePolicy option), then the -XX:SurvivorRatio option should be used to set the size of the survivor space for the entire execution of the application.

-XX:NewRatio=ratio

Sets the ratio between young and old generation sizes. By default, this option is set to 2. The following example shows how to set the young/old ratio to 1: -XX:NewRatio=1

-XX:NewSize=size

Sets the initial size (in bytes) of the heap for the young generation (nursery). Append the letter k or K to indicate kilobytes, m or M to indicate megabytes, g or G to indicate gigabytes.

-XX:ParallelGCThreads=threads

Sets the number of threads used for parallel garbage collection in the young and old generations. The default value depends on the number of CPUs available to the JVM.

-XX:+PrintGC

Enables printing of messages at every GC. By default, this option is disabled.

使用实例

java -Dspring.profiles.active=<ACTIVE> -server -Xms1g -Xmx2g -Xmn1g \
-XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintTenuringDistribution -XX:+PrintHeapAtGC -XX:+PrintReferenceGC \
-XX:+PrintGCApplicationStoppedTime -Xloggc:god-dump-gc.log \
-XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=14 \
-XX:GCLogFileSize=100M -XX:+HeapDumpOnOutOfMemoryError \
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 \
-jar *.jar
RK3588&RK3576实现 HW-ID DTB(动态加载不同的Kernel DTB)功能 RK平台的U-Boot⽀持检测硬件上的GPIO或者ADC状态动态加载不同的Kernel DTB,暂称为HW-ID DTB(Hardware id DTB)功能。 阅读详情

相关推荐

SocraticLM: Exploring Socratic Personalized Teaching with Large Language Models

大型语言模型(LLM)被认为是推进智能教育的一项关键技术,因为它们展示了深入理解教学场景和为学生提供个性化指导的潜力。然而,当前个性化教学中基于LLM的应用主要遵循“问答”范式,学生被动地获得答案和解释。在本文中,我们提出了苏格拉底式教学模式(SocraticLM ),它实现了一种苏格拉底式的“发人深省”的教学范式,实现了真正的课堂教师的角色,让学生积极参与到真正掌握解决问题所需的思考过程中。

weixin_43961909的博客 2894

飞书 Android 升级 JDK 11 引发的 CI 构建性能问题

本文从飞书 Android 升级 JDK 11 意外引发的 CI 构建性能劣化谈起,结合高版本 JDK 在 Docker 容器和 GC 方面的新特性,深挖 JVM 和 Gradle 的源码实现,抽丝剥茧地介绍了分析过程和修复方法,供其他升级 JDK 的团队参考。虽然最后解决了构建性能劣化的问题,但在整个引入问题-->发现问题-->分析问题的流程中还是有不少点可以改进。

ch98000的博客 881

Windows安装Pytorch3d

pytorch和pytorch3d版本对应关系如下:https://github.com/facebookresearch/pytorch3d/releasescuda和NVIDIA CUB版本对应关系如下:https://github.com/NVIDIA/cub/releases?page=1本人配置如下:GPU:1050TiCUDA:11.1python:3.8。

Snakewood的博客 4289

Day666.Java程序从虚拟机迁移到k8s的问题 -Java业务开发常见错误

Hello,这里是阿昌,今天学习记录的是关于的记录。使用 大规模部署应用程序,可以提升整体资源利用率,提高集群稳定性,还能提供快速的扩容能力,甚至还可以实现集群根据压力自动扩容。因此,现在越来越多的公司开始把程序从虚拟机(VM)迁移到 Kubernetes 了。在大多数的公司中,Kubernetes 集群由运维来搭建,而程序的发布一般也是由 平台完成。从虚拟机到 Kubernetes 的整个迁移过程,基本不需要修改任何代码,可能只是重新发布一次而已。所以,我们 Java 开发人员可能对迁移这个事情本身感

阿昌爱Java 1721

实战指南:如何用DCCRN模型提升语音增强效果(附代码示例)

本文提供了基于DCCRN模型进行语音增强的实战指南。通过深入解析复数网络如何协同处理语音的幅度与相位信息,并附有完整的PyTorch代码实现,帮助开发者从数据准备、模型搭建到训练调优,构建高效的实时语音增强系统,有效提升嘈杂环境下的语音清晰度。

weixin_29054245的博客 484

Cadence PCB仿真 使用Allegro PCB SI为BRD文件创建通用型IBIS模型的方法图文教程

本文简单介绍使用Allegro PCB SI软件为BRD PCB设计文件中的元器件创建IBIS模型的方法。

fydar的博客 2176

JVM 运行时参数

面试题JVM的参数,你知道的说一下 (百度)说说你知道的几种主要的JVM参数(京东)JVM调优调的哪些参数?在哪里写这些参数?(亚信)内存调优参数都有什么?(顺丰)JVM调优调的哪些参数?问这样有什么好处?在哪里写这些参数(浪潮)

一位打工仔的博客 854

基于 YOLOv26 的食品包装缺陷检测系统:智能视觉质检方案

本文提出了一种基于YOLOv26深度学习的食品包装缺陷智能检测系统。该系统能够自动识别多种常见包装缺陷,包括密封不良、破损、污染、标签错误等8类问题。相比传统人工检测方法,该系统具有高精度、多类别分类、实时推理等优势。文章详细介绍了系统架构,包含数据采集、预处理、YOLOv26检测模型和后处理四个核心模块,并提供了完整的环境配置和数据处理代码实现。该系统为食品包装行业提供了一种高效、准确的智能视觉质检解决方案。

一键难忘的博客 694

【Java虚拟机】JVM调优和分析案例综合实战

JVM调优和分析案例综合实战

互联网小阿祥 1406

ubuntu20.04中配置Pyrep和CoppeliaSim

在Ubuntu20.04中配置 Pyrep ,实现应用Python语言的机器人在 Vrep(CoppeliaSim)中的虚拟仿真。

加斯顿工程师的博客 3379

windows下宝塔安装教程

windows下宝塔安装教程 目录宝塔是什么?宝塔安装流程1.下载2.配置3.登录4.安装的环境套件小结 宝塔是什么? 宝塔是管理服务器的免费的软件,宝塔上面可以进行对你的服务器批量进行管理,对于运维人员来说还是必不可少的一个软件,值得使用。 宝塔安装流程 1.下载 链接: https://download.bt.cn/win/panel/BtSoft.zip 下载后安装买最好自定义目录,方便找 2.配置 下载完成后会出现这个页面,对着页面进行配置 点击默认密码复制进来,这里注意一点就是一定要查看

你在看屏幕的同时,屏幕也在注视着你 4436

Java中JVM常见调优以及对应参数使用

注意的是每个应用程序的调优需求是不同的,因此在实际应用时,应根据具体情况选择合适的参数进行调优。还可以通过监控工具来获取实时的JVM性能数据,以帮助更好地进行调优。JVM调优是为了提升Java应用程序的性能和稳定性。

lxl2092828212的博客 801

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

学习JVM参数前必须了解的

JVM参数是什么 大家照相通常使用手机就够用了,但是针对发烧友来说会使用更专业的设备,比如单反相机,在单反里有好几个模式,P/A/S/M,其中P是傻瓜模式,程序会自动根据环境设置快门速度和光圈大小,以得到相对合适的曝光效果。A档是光圈优先,用户可以自己设置光圈大小,快门速度等都交给相机程序来决定,类似半自动化的模式。S档是快门优先模式,和A档类似,只是用户可以设置快门速度。最后一个模式是...

weixin_41517387的博客 1021

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

JVM学习--JVM运行时参数

XX:+PrintFlagFinal,输出所有参数的名称和默认值,默认不包括 Diagnostic 和 Experimental 的参数,可以配合 -XX:+UnlockDiagnosticVMOptions 和 -XX:UnlockExperimentalVMOptions 使用。举例:-XX:-UseParallelGC 不使用并行垃圾收集器,-XX:+UseG1GC 启用G1垃圾收集器,-XX:+UseAdaptiveSizePolicy 自动选择年轻代区大小和相应的Survivor区比例。

weixin_44810581的博客 1489

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

参数有空格_学习JVM参数之前,这些东西你了解过吗?

JVM参数有多少相机调整的无非就那么几个参数值,那JVM参数到底有多少个呢,大概有1000多个,是不是让你很震惊,没错,确实有这么多。 大家可以到 JVM参数 | PerfMa应用性能技术社区 去看看所有这些JVM参数(注:这是PerfMa社区专门为大家分享JVM参数经验的讨论区),当然我们不一定非得对每个JVM参数要了解清楚,但是对一些常见的,有助于性能调优的JVM参数还是有必要了解一下的。JV...

weixin_39624864的博客 322

JVM学习之JVM参数

查看Windows下的JVM参数: Windows下默认classpath上的JVM参数获取 CMD上输入:java -XX:+PrintCommandLineFlags -version //JDK1.8 //初始堆 -XX:InitialHeapSize=265937728 //最大堆 -XX:MaxHeapSize=4255003648 -XX:+PrintCommandLineFla...

weixin_44181697的博客 417

JVM学习之路(七)——JVM配置参数

七、JVM配置参数 一、jvm配置参数分为3大类: 1、跟踪参数:跟踪、监控JVM状态,用于程序员JVM调优及故障排查 2、堆分配参数:分配堆内存 3、栈分配参数:分配栈内存 二、各类配置参数常用参数: 1、常用跟踪监控参数: ①打印gc简要信息 第一个:-XX:+PrintGC 第二个:-verbose:gc 这2个参数效果一样,都是在发生gc时,打印gc简要信息的。以 1...

u012556994的博客 3万+

JVM参数学习

开关 -XX:+UnlockExperimentalVMOptions和-XX:+UnlockDiagnosticVMOptions 可解锁JVM额外参数。 性能 -XX:MaxTenuringThreshold MaxTenuringThreshold这个参数用于控制对象能经历多少次Minor GC才晋升到旧生代 默认值是15 -XX:+-UseSpinning 自旋锁开启...

梦一样的博客,神话般的感觉 5864

后面的参数_给大家准备了个JVM参数学习的免费课程

缘起从2014年开始,那会还在蚂蚁中间件团队,慢慢有机会解决一些JVM的问题,后面因为对JVM的热爱,主要是好奇心使然,加入到了阿里JVM团队,开始了面向整个阿里工程师的JVM之路,没想到一发不可收拾,创业了还干了和JVM相关的一些事。说起JVM调优大部分人想到的也是JVM参数调优,当我们看到某个问题的时候,说加上某个参数或者调整下某个参数的值就搞定了,特有成就感,这也是促使我不断学习J...

weixin_32009121的博客 66

JVM学习问题记录(1) IDEA2025设置JVM启动参数

IDEA中找不到设置当前应用JVM参数的地方。

qq_37763312的博客 203

JVM学习-JVM运行时参数

JVM的JIT编译模式相关的选项。

丢爸 1302

【jvm学习记录】实战篇、27、垃圾回收参数调优

工作时间用来学这个东西,对工作的直接帮助不大。只怪立场不同,也并非完全不同,我肯定不做让步。公司和员工的步伐一致性高了,才会更好。但是 很多同事也都在刷抖音啥的,事实上只有为自己,才能走更远。

qq_41577703的博客 263

调整jvm参数_JVM学习系列学习一

本文主要内容:​一:为什么要对JVM进行优化?我们在自己电脑上进开发的时候,几乎很少考虑对JVM进行优化。但是,我们写的代码,放到生成环境会出现入下各种情况:1:运行的应用越来越“卡”了、日志不输出、页面点击没反应了2:为什么服务器CPU使用率突然飙升上来了3:在多线程应用下,如何分配线程数量?……怎么解决?重启吗?万能的重启服务吗?生成环境能随随便便就重启吗 ?通过本系列教程,我们将对JVM有更...

weixin_39601088的博客 93
上一篇: Linux下查看 java 进程所在目录和占用情况
下一篇: 让 Mac 外接键盘支持 HOME 键
howeres
博客等级 码龄11年 295粉丝 214原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值