Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
623 views
in Technique[技术] by (71.8m points)

macos - How to run 32-bit Java on Mac OSX 10.7 Lion

From my experience with Windows 7 (64-bit) and Java, a 32-bit JRE uses less memory and runs significantly faster than a 64-bit JRE (provided you don't need or benefit from having a lot of memory). I imagine the same thing is true for Mac OSX (and other platforms) as well.

I am currently running OSX Lion (v10.7), and I have installed the standard Java app. Under Java Preferences, I see "Java SE 6" from "Apple Inc." for both CPU-types "32-bit" and "64-bit" version "1.6.0_26-b03-383". I have changed the preferred order to put the 32-bit version on top of the 64-bit version, hoping that this would make the 32-bit version default.

But "java -version" still says:

java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03-383-11A511c)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-383, mixed mode)

Is it possible to use the 32-bit version by default? And how?

Also, does anyone have experiences / comparative measurements regarding speed and memory efficiency between the 32/64-bit versions?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I found out now, that the 32-bit JVM can be explicitly launched using the -d32 switch.

On my machine, "java -version -d32" says:

java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03-383-11A511c)
Java HotSpot(TM) Client VM (build 20.1-b02-383, mixed mode)

and although it doesn't say so, it is a 32-bit JVM.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...