Java allocates 64MB of memory per process by default. If you're getting an OutOfMemory error, then you're exceeding it.
Check the documentation for Tomcat4 (which I think is what you're running), and see how you can boost the max allowed memory.
posted 8 years ago
Another possibility is that you have some sort of recursion or infinite loop that keeps allocating objects until the JVM finally runs out of memory. I'd suggest taking a close look at your code. If you can't find the leak, you might try running it through a debugger or profiler.