As Arjay said, you have no terminating condition in your while loop; 'size' is always greater than 0 because you never decrease it (you actually add to it).