简体   繁体   English

Java JDK 32位对64位

[英]Java JDK 32 bits vs 64 bits

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. 我问自己是否有兴趣向用户提出32位和64位版本。

Is the difference only in having access to more memory heap size with the 64 bit version or is there any other interest ? 区别仅在于使用64位版本访问更多内存堆大小还是有其他兴趣?

Will a 32 bit compiled program work on a 64 bits JVM (I assume yes) 32位编译程序是否可以在64位JVM上运行(我假设是)

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. 任何程序的32位和64位版本之间的唯一区别是机器字的大小,可寻址内存的数量以及正在使用的操作系统ABI。 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. 对于Java,语言规范意味着机器字大小和OS ABI的差异根本不重要,除非您也使用本机代码。 (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.) 必须将本机代码构建为与将加载它的JVM的字大小相同;在没有非常奇特的编码的情况下,您不能在同一进程中混合使用32位和64位构建,并且您不应该'用Java来做这件事。)

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. 如果你只是在Java领域,那么实际上,除非你需要> 4GB的堆大小,否则差别很小。

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 . 编辑:差异包括它使用比32位更多的内存,如果您使用6u23之前的版本并且不使用-XX:+UseCompressedOops ,则显着更多。 There may also be a slight performance difference between the two, but again nothing huge. 两者之间可能存在轻微的性能差异,但同样没有什么大的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM