I am using the following piece of code in one of my methods in java:
int [] byte_song = new int[8414449];
int [] int_song = new int[8414449 - 45];
If i just write:
int [] byte_song = new int[8414449];
it does not give me any error. However if i write:
int [] byte_song = new int[8414449];
int [] int_song = new int[8414449 - 45];
it gives me OutOfMemoryError
.
I also tried calling System.gc();
before int []int_song = new int[8414449 - 45];
still i get the error. Can some body please help me out in this.