Make a very large Java array

I'm trying to find a reverse example. P ó lya project will be 900 million somewhere I use a very efficient algorithm that doesn't even require any factorization (similar to Eratosthenes' filtering, but there is more information, so I need a lot of int

The program is efficient and correct, but requires an array until x I want to check (it checks all numbers from (2, x) So if the counterexample is at 900 million, I need an array that will be the same size Java won't make me anything more than 20 million What can I do to get a large array?

Solution

You may want to expand the maximum size of the JVM heap You can do this using command line options

I believe it is - xmx3600m (3600 megabytes)

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>