"野马"的VM
来源:互联网 发布:云计算技术的发展趋势 编辑:程序博客网 时间:2024/06/10 20:10
今天是06年的第一天,我居然还是要无聊到写BLOG,哎~长象问题啊~没人陪!
今天无意中看了下Java6.0 ,代号"野马"。难道sun这回在寓意java的执行速度???
管他的先下回来看看先
java6.0Releases
http://download.java.net/jdk6/binaries/
很快就装好了,于是按老习惯写了个测试程序,看看是不是匹"野马"呵呵
public class Main {
public static void main(String[] args) {
// TODO code application logic here String strTest="";
double t1=System.currentTimeMillis();
for(int i=0;i<=5000;i++)
strTest+="Demo"+i;
double t2=System.currentTimeMillis();
System.out.print(t2-t1);
}
}
上面这段主要是测试字符串累加/装箱,5000个对象还可以测试GC收集的速度.
好了不多说 直接执行
java 1.5
javac Main.java
java Main
output:4532
java 1.6
javac Main.java
java Main
output:2342
呵呵,没错居然块了差不多一半 ,看来还真是一匹"野马".
但是如果用java 1.6 的javac 后 用1.5的java来执行则会报错!
不会是不向下兼容把,因该不会这样,可能在正式版会得到改进
java 1.6VM
java从1.5版开始就内置了2种配置情况的VM
Java HotSpotTM Client VM(The client VM is tuned for reducing start-up time and memory footprint)
Java HotSpot Server VM(The server VM is designed for maximum program execution speed)
当然可以在java加载程序的时候,来指定要使用的VM
比如(注意都是小写)
java -client Main
java -server Main
各平台默认VM
PlatformDefault VMArchitectureOSclient VMif server-class, server VM;
otherwise, client VMserver VMSPARC 32-bitSolarisXi586SolarisXLinuxXMicrosoft WindowsXSPARC 64-bitSolaris—XAMD64Linux—XMicrosoft Windows—X
Legend: X = 默认 VM — = 没有 client VM
Note: For J2SE 5.0, the definition of a server-class machine is one with at
least 2 CPUs and at least 2GB of physical memory.
(从j2se1.5开始,只有至少2颗CPU和至少2G内存的及其才定义为服务器机器)
另外,"野马"中VM还增加了3个特色:
Adaptive compiler(合适的编译器) - Applications are launched using a standard
interpreter, but the code is then analyzed as it runs to detect performance
bottlenecks, or "hot spots". The Java HotSpot VMs compile those performance-critical
portions of the code for a boost in performance, while avoiding unnecessary
compilation of seldom-used code (most of the program). The Java HotSpot VMs
also use the adaptive compiler to decide, on the fly, how best to optimize
compiled code with techniques such as in-lining. The runtime analysis
performed by the compiler allows it to eliminate guesswork in determining
which optimizations will yield the largest performance benefit. Rapid memory(高速内存) allocation and garbage collection - Java HotSpot technology
provides for rapid memory allocation for objects, and it offers a choice
of fast, efficient, state-of-the-art garbage collectors.
multiple, concurrent paths of program execution (called "threads").
Java HotSpot technology provides a thread-handling capability that is
designed to scale readily for use in large, shared-memory multiprocessor
servers
看来Sun也开始模仿MSJIT技术拉,不错从开头的那段程序我们就能看的出来~
不过有竞争才是好事,那样才能促使技术的进步!
- "野马"的VM
- 新java:野马的6大新特性
- JDK1.6(Mustang野马)的新特性
- 驾驭“野马”-- 探索Java SE 6的一些新特性
- 野马的性格 Java SE 6.0新特性体验
- 野马的性格 Java SE 6.0新特性体验
- 你是一匹野马,过分留恋草原的意思
- 冷门实用的定律(四):野马结局
- 当人工智能变成一匹脱缰的野马
- 福特野马
- 野马的性格 Java SE 6.0新特性体验(转自天极网)
- gc野马通过压力测试(只有1K单位的容量,gc作用明显)
- 野马川煤矿事故
- 野马table排序初探
- gc野马跑过CONS
- Rococo(cons野马)
- 蚌和野马
- VM workstation 与 VM vSphere的区别
- 消费者生产者模型-java 线程模拟
- 过节了 我找了一些漂亮图片 大家一起欣赏吧
- STL vector 辅助函数
- 汇编语言超浓缩教程
- about version control
- "野马"的VM
- 开始新的BLOG
- 转:增值博客的22条军规
- [原创]CSDN Blog部分技巧
- Intel 免费赠送IA-32构架手册和程序开发指南
- Look'n'Stop防火墙专贴
- 2006年的第一天,我开始写我的.NET学习blog
- start to use csdn's blog
- .net关于企业Excel报表的生成 (转贴 作者yangyifan)