You are probably getting into an infinite loop or recursion that creates a lot of new objects until it's out of heap space. Check your loop conditions or recursive calls and make sure they are terminating as they should.
Ezzaral
Posting Genius
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
possibly
for(int r = row; row<8; r++) {
for(int c = column; c>-1; c--) {
System.out.println("c "+c);
if(board[r][c]!=null||board[r][c].getTeam()!=board[row][column].getTeam()) {
//locations.add(new Location(r, c));
//count++;
}
if(board[r][c].getTeam()==board[row][column].getTeam()||board[r][c].getTeam()!=board[row][column].getTeam()) {
c = -1;
row = 8;
}
}
}
or perhaps "row" is 1- prior to entering the outer loop?
Ezzaral
Posting Genius
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847