Sparta Systems interview question

how could a program in java/c run out of memory?