memory management dude in java se 6

Hi all!

I don't know if that question involves that forum. I'm developing an application. I execute code like this in java se 6 beta version:

publicclass MyApplication

{

publicstaticvoid main(String Args[])

{

MyMatrix foo;

for(int i = 100; i <100000; i += 100)

{

foo =new MyMatrix(i, i);

doSomethingWith(foo);

}

}

}

publicclass MyMatrix

{

privatedouble[][] theMatrix;

public MyMatrix(int rows,int columns)

{

theMatrix =newdouble [rows][columns];

}

}

When i

in the main method gets value 1700, I get an out of memory error. I'm using Windows XP and I have 512 RAM. My machine seems to have a lot of free memory. Is last matrix memory freed correctly when I execute foo =new MyMatrix(i, i);

?

Is it a compiler's problem?

Anyone can help me, please?

Thank you in advance.

[1810 byte] By [developerstudenta] at [2007-10-3 7:58:32]
# 1
You are creating a massive number of ints. When you create a 1700x1700 array of ints, you are creating 2,890,000 (1700^2) ints. So when you are looping up to 1700, you are 1,639,111,950 ints.
CaptainMorgan08a at 2007-7-15 3:01:33 > top of Java-index,Developer Tools,Java Compiler...