Hi so I've been having trouble with this one exception I've been getting. It says it's on line 22 but I don't understand why I'm getting it. BTW I'm using Eclipse on a Mac.

Code:

Code:
import java.util.*;

public class ProjectEulerProb2 {

	int firstInt=1, secondInt=0, thirdInt = 0;
	ArrayList<Integer> list = new ArrayList<Integer>();
	
	public static void main(String args[]){
		
		ProjectEulerProb2 prob = new ProjectEulerProb2();
		prob.doIt();
		
	}
	
	public void doIt(){
		
for(long i = 0; i<=4000000;i++){
			
			secondInt = firstInt+firstInt;
			list.add(secondInt);
			firstInt = secondInt;
			list.add(firstInt);
			thirdInt = firstInt+secondInt;
			list.add(thirdInt);
		}
		
	}
	
}
Exception:

Code:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
	at java.util.Arrays.copyOf(Arrays.java:2760)
	at java.util.Arrays.copyOf(Arrays.java:2734)
	at java.util.ArrayList.ensureCapacity(ArrayList.java:167)
	at java.util.ArrayList.add(ArrayList.java:351)
	at ProjectEulerProb2.doIt(ProjectEulerProb2.java:22)
	at ProjectEulerProb2.main(ProjectEulerProb2.java:11)