制作一个非常大的Java数组 [英] Making a very large Java array

查看:122
本文介绍了制作一个非常大的Java数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找到一个反到波利亚猜想这将是某处900百万。我使用的是一种非常有效的算法,甚至不要求任何分解(类似于埃拉托色尼的筛子,但随着更多的信息,因此,需要整数的大阵。

I'm trying to find a counterexample to the Pólya Conjecture which will be somewhere in the 900 millions. I'm using a very efficient algorithm that doesn't even require any factorization (similar to a Sieve of Eratosthenes, but with even more information. So, a large array of ints is required.

该计划是有效的,正确的,但需要一个数组到我要检查的X(它会检查所有的数字从(2,X))。因此,如果反在900百万,我需要一个数组,这将是一样大的。 Java将不会允许我在2000万左右什么。有什么我能做得到一个数组大?

The program is efficient and correct, but requires an array up to the x i want to check for (it checks all numbers from (2, x)). So, if the counterexample is in the 900 millions, I need an array that will be just as large. Java won't allow me anything over about 20 million. Is there anything I can possibly do to get an array that large?

推荐答案

您可能要扩展JVM堆的最大尺寸。你可以做到这一点与命令行选项。

You may want to extend the max size of the JVM Heap. You can do that with a command line option.

我相信这是-Xmx3600m(3600兆字节)

I believe it is -Xmx3600m (3600 megabytes)

这篇关于制作一个非常大的Java数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆