Why should I use the 64-bit JDK over the 32-bit version?

前端 未结 3 2016
轮回少年
轮回少年 2020-12-14 02:28

I use Eclipse and 64-bit Windows and develop Java desktop applications. So far, I have only used the 32-bit JDK, but is there any reason to change to 64-bit JDK for Java dev

3条回答
  •  一整个雨季
    2020-12-14 02:38

    Try this:

    public class Benchmark {
        public static void main(String args[]) {
            long time = System.currentTimeMillis();
            for (int a = 1; a < 900000000; a++) {
                for (int b = 1; b < 20; b++) {
                }
            }
            long time2 = System.currentTimeMillis() - time;
            System.out.println("\nTime counter stopped: " + time2);
        }
    }
    

    In 32 and 64 bit and laugh at the difference.

提交回复
热议问题