Java JDK 32 bits vs 64 bits

拜拜、爱过 提交于 2019-12-19 17:34:36

问题


I am creating a quite simple application which reads and display text files and search through them.

I am asking myself if there is any interest for me to propose 32 and 64 bits version to the user.

Is the difference only in having access to more memory heap size with the 64 bit version or is there any other interest ?

Will a 32 bit compiled program work on a 64 bits JVM (I assume yes)


回答1:


The only differences between 32-bit and 64-bit builds of any program are the sizes of machine words, the amount of addressable memory, and the Operating System ABI in use. With Java, the language specification means that the differences in machine word size and OS ABI should not matter at all unless you're using native code as well. (Native code must be built to be the same as the word-size of the JVM that will load it; you can't mix 32-bit and 64-bit builds in the same process without very exotic coding indeed, and you shouldn't be doing that with Java about.)




回答2:


The only times that have swung it for me is when there have been native libraries involved that have pushed it one way or the other. If you're just in Java land then realistically, unless you need >4GB of heap size, there's very little difference.

EDIT: The differences include things like it uses slightly more memory than 32 bit, significantly more if you're using a version before 6u23 and aren't using -XX:+UseCompressedOops. There may also be a slight performance difference between the two, but again nothing huge.



来源:https://stackoverflow.com/questions/8880483/java-jdk-32-bits-vs-64-bits

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!