Aug 11 2011

JAVA 7 第一次装

Category: 技术ssmax @ 17:12:25

Oracle 收购java以后貌似一直都没啥大动作,今天帮服务器装jdk,上去发现java 7已经是推荐版本了,下载了一个试试看

rpm包就一个 jdk-7-linux-i586.rpm

比以前清爽了一点,以前jdk6的时候是一个自解压包,运行以后装一堆docs啊db啊之类的rpm,看得不爽。

装完以后看看目录结构,没啥大变化

>java -version
java version “1.7.0”
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) Client VM (build 21.0-b17, mixed mode, sharing)

>javac -version
javac 1.7.0

看小版本号竟然已经到174了,呵呵

不知道加了些什么新特性,用了这么久好像jdk6的新特性都没怎么用上,唉,老了老了

 

release notes:

http://www.oracle.com/technetwork/java/javase/jdk7-relnotes-418459.html

 

看了一下G1 GC仍然是试验阶段,啥时候能转正啊。。。

http://www.oracle.com/technetwork/java/javase/jdk-7-readme-429198.html

Using G1

G1 is still considered experimental and can be enabled with the following two
parameters:

-XX:+UnlockExperimentalVMOptions -XX:+UseG1GC

To set a GC pause time goal, use the following parameter:

-XX:MaxGCPauseMillis =50 (for a pause time target of 50ms)

With G1, a time interval can be specified during which a GC pause should last
no longer than the time given above:

-XX:GCPauseIntervalMillis =200 (for a pause interval target of
200ms)

Note that the above two options represent goals, not promises or guarantees.
They might work well in some situations but not in others, and the GC might not
always be able to obey them.

Alternatively, the size of the young generation can be specified explicitly
to impact evacuation pause times:

-XX:+G1YoungGenSize=512m (for a 512 megabyte young generation)

G1 also uses the equivalent of survivor spaces, which are, naturally, a set
of (potentially non-contiguous) regions. Their size can be specified with the
usual parameters (e.g., -XX:SurvivorRatio=6).

Finally, to run G1 at its full potential, try setting these two parameters
which are currently disabled by default because they may uncover a rare race
condition:

-XX:+G1ParallelRSetUpdatingEnabled
-XX:+G1ParallelRSetScanningEnabled

One more thing to note is that G1 is very verbose compared to other HotSpot
GCs when -XX:+PrintGCDetails is set. This is because it prints per-GC-thread timings and other information very helpful in profiling and trouble-shooting. If you want a more concise GC log, please switch to using -verbosegc (though it is recommended that the more detailed GC log
be obtained).