Assuming you dont have some type of infinite loop that uses an infinite amout of memory, right click on your computer icon on your desktop, go to <properties><advanced><enviornment variables> and add the following enviornment variable:
JAVA_OPTS-Xmx1024m
This should allow your JVM to use up a lot more memory (assuming your machine has 1Gbytes of memory).
Are you running tomcat from within Eclipse when this happens? If so, in Eclipse, from the menu go to <window><preferences><tomcat><jvm settings><append to jvm parameters><add> and enter-Xmx1024m
Next, on your desktop, try <cntr><alt><del> <task manager> <performance> and see how much memory you are using with your IDE running before you run your application, then after you run it. Buy more memory if you need it (its cheap!!!). You probably should have at least 2 Gigabtyes. Wouldn't hurt to defragment your hard disk at this time too.