zoukankan      html  css  js  c++  java
  • java jar 启动参数

    1.-Dspring.profiles.active=dev
    这个可以在spring-boot启动中指定系统变量,多环境(测试、预发、线上配置)的区分
    3. jvm堆设值: -Xmx3550m -Xms3550m -Xmn2g -Xss128k
    4.

    -client,-server

    这两个参数用于设置虚拟机使用何种运行模式,client模式启动比较快,但运行时性能和内存管理效率不如server模式,通常用于客户端应用程序。相反,server模式启动比client慢,但可获得更高的运行性能。
    在 windows上,缺省的虚拟机类型为client模式,如果要使用 server模式,就需要在启动虚拟机时加-server参数,以获得更高性能,对服务器端应用,推荐采用server模式,尤其是多个CPU的系统。在 Linux,Solaris上缺省采用server模式。

    -D< propertyName>=value

    在虚拟机的系统属性中设置属性名/值对,运行在此虚拟机之上的应用程序可用System.getProperty(“propertyName”)得到value的值。如果value中有空格,则需要用双引号将该值括起来,如-Dname=”space string”。
    该参数通常用于设置系统级全局变量值,如配置文件路径,应为该属性在程序中任何地方都可访问。

    JVM 参数
    这里写图片描述

    启动springBoot时示例

    /usr/local/java/jdk1.8.0_131/bin/java -jar -server -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/data/spb_zcmweb/8103/dump/heap/
    -Djava.io.tmpdir=/data/spb_zcmweb/8103/tmp/
    -Dserver.port=8103
    -Dcom.sun.management.jmxremote
    -Dcom.sun.management.jmxremote.port=5103
    -Dcom.sun.management.jmxremote.rmi.port=6103
    -Dcom.sun.management.jmxremote.authenticate=false
    -Dcom.sun.management.jmxremote.ssl=false
    -Dcom.sun.management.jmxremote.access.file=/usr/local/java/jdk1.8.0_131/jre/lib/management/jmxremote.access
    -Xmx2G -Xms2G -XX:+DisableExplicitGC -verbose:gc -Xloggc:/data/spb_zcmweb/8103/log/gc.%t.log -XX:+PrintHeapAtGC -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCTaskTimeStamps -XX:+PrintGCDetails -XX:+PrintGCDateStamps
    -Dserver.connection-timeout=60000
    -Dserver.tomcat.accept-count=1000
    -Dserver.tomcat.max-threads=300
    -Dserver.tomcat.min-spare-threads=65
    -Dserver.tomcat.accesslog.enabled=false
    -Dserver.tomcat.accesslog.directory=/data/spb_zcmweb/8103/log/
    -Dserver.tomcat.accesslog.prefix=access_log
    -Dserver.tomcat.accesslog.pattern=combine
    -Dserver.tomcat.accesslog.suffix=.log
    -Dserver.tomcat.accesslog.rotate=true
    -Dserver.tomcat.accesslog.rename-on-rotate=true
    -Dserver.tomcat.accesslog.request-attributes-enabled=true
    -Dserver.tomcat.accesslog.buffered=true
    -XX:NewRatio=4 -XX:SurvivorRatio=30 -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=8 -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -XX:ParallelGCThreads=24 -XX:ConcGCThreads=24 -XX:-UseGCOverheadLimit -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSFullGCsBeforeCompaction=1 -XX:+CMSParallelRemarkEnabled -XX:+CMSScavengeBeforeRemark -XX:+ParallelRefProcEnabled -XX:+UseCMSCompactAtFullCollection -XX:CMSMaxAbortablePrecleanTime=6000 -XX:CompileThreshold=10 -XX:MaxInlineSize=1024 -Dsun.net.client.defaultConnectTimeout=60000
    -Dsun.net.client.defaultReadTimeout=60000
    -Dnetworkaddress.cache.ttl=300 -Dsun.net.inetaddr.ttl=300
    -Djsse.enableCBCProtection=false
    -Djava.security.egd=file:/dev/./urandom
    -Dfile.encoding=UTF-8
    -Dlog.path=/data/spb_zcmweb/8103/log/
    -Dspring.profiles.active=online
    /data/spb_zcmweb/8103/deploy/zcmweb.jar zcmweb

  • 相关阅读:
    041.PGSQL-pgsql常用命令-查看日志文件大小、数据目录、运行日志相关配置、当前lsn
    041.PGSQL-pgsql时间日期错误问题,原来是系统时间问题,使用远程的NTP时间服务器来提供时间的话,需要使用timedatectl设置将NTP时间同步开启。
    040.PGSQL-备份和恢复-增量备份-创建基础备份
    039.PGSQL-备份和恢复-增量备份-开启wal归档、并设置定时清理备份之后的wal文件
    037.PGSQL-事务 savepoint 保存点、rollback to 回滚
    硬件黑客之无线电安全 --- Proxmark3 RDV4 套件
    我有一个想法。。。
    硬件嘿客之嘿客仓库
    WPA GPU基准测试
    什么是家用路由器,带你重新认识一下
  • 原文地址:https://www.cnblogs.com/javalinux/p/14106808.html
Copyright © 2011-2022 走看看