`

转:Java Configuration for Blandware AtLeap

阅读更多
  源自:http://www.wujianrong.com/

Java Configuration for Blandware AtLeap

To have a stable, robust and fast work of AtLeap you should configure your JVM (Java Virtual Machine) properly. JVM configuration is realized by force of passing parameters. For example for Tomcat you should specify CATALINA_OPTS environment variable, for Resin you should pass it directly into startup script (httpd.exe or httpd.sh), for JBoss you should define JAVA_OPTS environment variable, as for other servlet containers see its documentation.

Let’s examine typical set of JVM arguments


 



  • -server



Enable HotSpot Server JIT java compiler. It generates more robust and optimized code, but it slower than HotSpot Client (-client option) during compilation. See for more information http://java.sun.com/docs/hotspot/index.html http://java.sun.com/products/hotspot/ I recommend use –client for development mode and –server for production mode.

 



  • -Djava.awt.headless=true



You need it to have a correct work of graphics parts if the X server is not installed on Linux.

 



  • -Dfile.encoding=UTF-8



Specify it to make sure.

 



  • -Xms128m



Specify the initial size, in bytes, of the memory allocation pool (128 megabytes in our case).

 



  • -Xmx256m



Specify the maximum size, in bytes, of the memory allocation pool (256 megabytes in our case). It should be between ½ and ¾ of physical memory. It is need to avoid problem OutOfMemoryError. You may also be able to avoid this problem by setting the command-line flags -Xmx and -Xms to the same value to prevent the VM from trying to expand the heap. Note that simply increasing the value of -Xmx will not help when no swap space is available.

 



  • -XX:PermSize=64m



Specify the initial size of the permanent generation (where the VM stores the classes and methods data).

 



  • -XX:MaxPermSize=128m



Specify the max size of the permanent generation (where the VM stores the classes and methods data). If case of the -server option is enabled the default value equal to 64m but in case of java.lang.OutOfMemoryError: PermGen space error you should increase this value. TIP This option does not exist in Bea JRockit and IBM JVMs.

 



  • -XX:NewSize=16m



Specify the initial size of the young generation (where the VM stores the short-lived objects).

 



  • -XX:MaxNewSize=24m



Specify the maximum size of the young generation (where the VM stores the short-lived objects).

Please carefully read Java documentation for your platform. For example TIP for Solaris it is recommended to specify -XX:-UseLWPSynchronization option.


If your machine has more than two CPU the following options can be useful: -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled They allow to enable Concurrent Low Pause Collector.


If your machine has more than two CPU and your Sun JDK 1.5.0_06 or more you can try to use -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:+UseAdaptiveSizePolicy in order to enable throughput collector.


if you have a IPv6 OS core but need to work with IPv4 addresses specify -Djava.net.preferIPv4Stack=true


ALERT! If you startup Tomcat under Windows as service you should specify JVM options via Windows registry HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ApacheTomcat\Parameters (add JVM Option Number N string value and increase JVM Option Count).


As result for Linux we can get following line CATALINA_OPTS="-server -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Xms128m -Xmx256m -XX:PermSize=64m -XX:MaxPermSize=128m -XX:NewSize=16m -XX:MaxNewSize=24m"


As for options for Ant you can use e.g. the following line: ANT_OPTS="-Djava.awt.headless=true -Dfile.encoding=UTF-8 -Xms64m -Xmx128m"


ALERT! Be careful, non-standard JVM options (which begins from -XX:) can be applied only for Sun's JVM. In order to make tuning of IBM or Bea's JVMs please read documentation.


Below links can be useful during JVM tuning:


分享到:
评论

相关推荐

    官方commons-configuration-1.10的jar包

    Apache Commons Configuration 是一个Java库,专门用于处理配置文件和提供灵活的访问机制。这个库的主要目标是简化在Java应用程序中管理配置参数的过程。在给定的"commons-configuration-1.10"版本中,我们可以深入...

    BIOS Configuration for HP ProtectTools

    This package contains BIOS Configuration for HP ProtectTools for the supported desktop models and operating systems.

    commons-configuration-1.10-API文档-中文版.zip

    赠送jar包:commons-configuration-1.10.jar 赠送原API文档:commons-configuration-1.10-javadoc.jar 赠送源代码:commons-configuration-1.10-sources.jar 包含翻译后的API文档:commons-configuration-1.10-...

    MyBatis学习笔记(一):MyBatis configuration和mapper xml配置总结

    本笔记将详细解析MyBatis的configuration配置文件和Mapper XML配置,帮助你深入掌握这两个核心组件。 首先,我们来看MyBatis的`configuration`配置文件。这个XML文件是MyBatis系统的核心,包含了MyBatis运行所需的...

    完美解决方案:Java生成复杂Word文档

    【Java生成复杂Word文档的完美解决方案】 在Java开发中,生成复杂的Word文档一直是一个挑战,尤其是在满足严格的格式和打印需求时。传统的解决方案如Apache POI和iText在处理大量表格、图片以及复杂的文档布局时,...

    commons-configuration2-2.1.1-API文档-中文版.zip

    标签:apache、commons、configuration2、中文文档、jar包、java; 使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可纵览文档内容。 人性化翻译,文档中的代码和结构保持不变,注释和说明精准...

    JAVA2 JAVA2 JAVA2

    12. **J2ME嵌入式开发**:Java2的J2ME版本为移动设备和嵌入式系统提供了开发环境,支持MIDP(Mobile Information Device Profile)和CLDC(Connected Limited Device Configuration)。 这些技术和特性使得Java2...

    commons-configuration-1.7-API文档-中文版.zip

    Maven坐标:commons-configuration:commons-configuration:1.7; 标签:commons、configuration、中文文档、jar包、java; 使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可纵览文档内容。 ...

    Java_for_the_Web_with_Servlets

    ### Java for the Web with Servlets: A Comprehensive Overview #### Introduction "Java for the Web with Servlets, JSP, and EJB: A Developer’s Guide to J2EE Solutions" by Budi Kurniawan is a ...

    commons-configuration-1.10-API文档-中英对照版.zip

    Maven坐标:commons-configuration:commons-configuration:1.10; 标签:configuration、commons、jar包、java、中英对照文档; 使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可纵览文档内容...

    spark-assembly linux下运行local模式缺失包

    com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'akka.version' at com.typesafe.config.impl.SimpleConfig.findKey(SimpleConfig.java:124) at ...

    commons-configuration-1.7-API文档-中英对照版.zip

    Maven坐标:commons-configuration:commons-configuration:1.7; 标签:commons、configuration、中英对照文档、jar包、java; 使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可纵览文档内容。...

    java.lang.UnsupportedClassVersionError问题解决

    ### java.lang.UnsupportedClassVersionError问题解析与解决方案 在Java开发过程中,经常会在部署或运行时遇到`java.lang.UnsupportedClassVersionError`错误。该错误通常发生在类文件版本与JVM(Java虚拟机)版本...

    commons-configuration2-2.1.1-API文档-中英对照版.zip

    标签:apache、commons、configuration2、中英对照文档、jar包、java; 使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可纵览文档内容。 人性化翻译,文档中的代码和结构保持不变,注释和说明...

    谷歌java格式-重新格式化 Java 源代码以符合 Google Java 风格

    谷歌java格式 google-java-format是一个重新格式化 Java 源代码以符合 Google Java Style的程序。 使用格式化程序 从命令行 下载格式化程序 并运行它: java -jar /path/to/google-java-format-${GJF_VERSION?}-all...

    JAVA中文文档.chm.zip

    文档将介绍如何在资源有限的设备上进行Java开发,包括KVM(Java虚拟机)和CLDC(Connected Limited Device Configuration)的相关知识。 6. **并发编程**:Java提供强大的并发编程支持,包括线程、同步机制...

    java me实例代码

    常见的配置有CLDC(Connected Limited Device Configuration)和CDC(Connected Device Configuration),而像MIDP(Mobile Information Device Profile)则是针对移动设备的应用程序框架。 2. **KVM与JVM**:Java ...

    org.apache.commons.configuration.XMLConfiguration的读取范例

    Apache Commons Configuration 是一个Java库,它提供了一组高级配置接口和类,用于处理应用程序的配置文件。在这些接口中,`XMLConfiguration` 是一个重要的组件,专门设计用来处理XML格式的配置文件。在这个范例中...

    javame讲解PPT

    1. **JavaME架构**:JavaME包括配置(Configuration)、框架(Profile)和API层。配置定义了硬件和操作系统的基本要求,如CLDC(Connected Limited Device Configuration)针对内存有限的设备;框架则进一步细化功能...

Global site tag (gtag.js) - Google Analytics