Handling very large arrays in java
800343May 26 2008 — edited May 27 2008Hi
I'm developing an application which needs an int array of size 100,000,000 ( ie. int[] arr = new int[100000000];)
Now When I run this line of code on my pc I get a java heap memory error. The largest array I can make is 15,000,000 units.
I have 1Gb of memory on my system and I have set -Xms512m -Xmx1024m in my Eclipse settings.
What I don't understand is that when I run this same code in Visual Studio and C# it runs fine (I only get a memory error at 300,000,000 )
I'm pretty sure that c# doesn't manage memory that much better than Java, what could be causing this?
Thanks