一、Common Problems in Java SE Application

This message is based on the following materials.
http://java.sun.com/developer/technicalArticles/J2SE/monitoring/#Insufficient_Memory
http://java.sun.com/developer/technicalArticles/javase/troubleshoot//

本日志由 flyinweb 于 2010-01-13 17:32:57 发表到 技术文摘 中,目前已经被浏览 6901 次,评论 0 次;

作者添加了以下标签: JVMGCGarbage collection

首页只显示了部分日志内容,要查看日志的全部内容请阅读全文

JVM Options For GC

本日志由 flyinweb 于 2010-01-12 16:16:11 发表到 技术文摘 中,目前已经被浏览 4061 次,评论 0 次;

作者添加了以下标签: JVMGC

首页只显示了部分日志内容,要查看日志的全部内容请阅读全文

JVM的自动垃圾收集(Garbage Collection)使得开发人员无需关注垃圾收集的细节,不过,当内存问题成为系统瓶颈的时候,我们就需要了解一下JVM的垃圾收集机制了。

本日志由 flyinweb 于 2010-01-11 15:03:04 发表到 技术文摘 中,目前已经被浏览 4213 次,评论 0 次;

作者添加了以下标签: JVMGarbage CollectionGC

首页只显示了部分日志内容,要查看日志的全部内容请阅读全文

Solaris and Linux Installation Instructions

J2SE Installation

If you have not already downloaded and installed the J2SE 5.0 JDK, please do so now. Follow the J2SE 5.0 JDK download and installation instructions. Once you have a working J2SE 5.0 JDK installation, continue with jvmstat Tools Installation. Note that the J2SE 5.0 JRE does not contain the class files need to run the jvmstat 3.0 tools. You must download the J2SE 5.0 JDK to run the jvmstat 3.0 tools.

jvmstat Tools Installation

The jvmstat tools distribution is released in both tar and zip formats. There is a single distribution for all supported platforms. These instructions will guide you though the installation process using the Korn Shell on Solaris, Linux, and for the Korn Shell in the MKS Tookit for Windows. Every effort has been made to use shell commands that are compatible with both the Bourne and Korn shells. You may need to adapt these instructions to your preferred shell.

To use the tar archive, you must have a tar executable on your system. Similarly, to use the zip format, you need to have an unzip executable on your system. The jar command can be used in place of the unzip command, as jar files are an extension of zip archives. In any case, these instructions assume that the necessary executable can be found in a directory included in the user's PATH environment variable.

In the following instructions, the > character represents the shell's command prompt and the commands you enter to the shell are indicated by text typeset in bold. These instructions will also contain references to JVMSTAT_HOME and JAVA_HOME strings. Although these appear to be environment variables at first glance, they are intended to be substituted with the paths to the installation directories for jvmstat and the Java 2 JDK, respectively. You may choose to create environment variables with these names; however, they are not required for proper installation or operation of the jvmstat tools.

本日志由 flyinweb 于 2010-01-06 10:49:09 发表到 技术文摘 中,目前已经被浏览 4881 次,评论 0 次;

作者添加了以下标签: jvmstatjvm

首页只显示了部分日志内容,要查看日志的全部内容请阅读全文

This document provides information on typical command-line options and environment variables that can affect the performance characteristics of the Java HotSpot Virtual Machine. Unless otherwise noted, all information in this document pertains to both the Java HotSpot Client VM and the Java HotSpot Server VM.

本日志由 flyinweb 于 2009-12-17 14:16:52 发表到 技术文摘 中,目前已经被浏览 3765 次,评论 0 次;

作者添加了以下标签: JVM

首页只显示了部分日志内容,要查看日志的全部内容请阅读全文

Java语言具备GC(垃圾回收)的能力,内存管理不需要应用程序去过问,这很方便。但是,GC是怎么进行的,JVM的内存参数应该怎么调整,如何优化,往往我们不是太清楚。看过一些资料后,对Sun JVM的内存管理以及垃圾回收的机制大概有了一个概念,这里将这些资料归纳和翻译出来。本文内容主要基于Sun JVM 1.3.1,在后续版本中有不少优化措施,但是这些基本概念还是不变的。

本日志由 flyinweb 于 2009-12-11 18:39:48 发表到 技术文摘 中,目前已经被浏览 4859 次,评论 0 次;

作者添加了以下标签: JVM内存管理垃圾回收

首页只显示了部分日志内容,要查看日志的全部内容请阅读全文

JVM内存JAVA_OPTS参数

最近几个月,做的性能测试项目中,发现了一些内存方面的问题,其中有涉及到对JBOSS里的JAVA_OPTS配置,例如一下所示;
JAVA_OPTS=”-server -Xms1536m -Xmx1536m -XX:NewSize=320m -XX:MaxNewSize=320m -XX:PermSize=96m -XX:MaxPermSize=256m -Xmn500m -XX:MaxTenuringThreshold=5″
JAVA_OPTS并不是已成不变的,不同的应用、软硬件环境下,要想充分发挥应用的性能,这些参数里边的设置可是非常有技巧和具有经验积累的。
经过查找资料,先看下JAVA_OPTS参数表示的意义。

-server:一定要作为第一个参数,在多个CPU时性能佳
-Xms:初始Heap大小,使用的最小内存,cpu性能高时此值应设的大一些
-Xmx:java heap最大值,使用的最大内存
上面两个值是分配JVM的最小和最大内存,取决于硬件物理内存的大小,建议均设为物理内存的一半。-XX:PermSize:设定内存的永久保存区域
-XX:MaxPermSize:设定最大内存的永久保存区域
-XX:MaxNewSize:
-Xss 15120 这使得JBoss每增加一个线程(thread)就会立即消耗15M内存,而最佳值应该是128K,默认值好像是512k.
+XX:AggressiveHeap 会使得 Xms没有意义。这个参数让jvm忽略Xmx参数,疯狂地吃完一个G物理内存,再吃尽一个G的swap。
-Xss:每个线程的Stack大小
-verbose:gc 现实垃圾收集信息
-Xloggc:gc.log 指定垃圾收集日志文件
-Xmn:young generation的heap大小,一般设置为Xmx的3、4分之一
-XX:+UseParNewGC :缩短minor收集的时间
-XX:+UseConcMarkSweepGC :缩短major收集的时间
提示:此选项在Heap Size 比较大而且Major收集时间较长的情况下使用更合适。

本日志由 flyinweb 于 2009-09-22 11:57:57 发表到 Linux 中,目前已经被浏览 4894 次,评论 0 次;

作者添加了以下标签: JVMJAVA_OPTS