java.lang.OurOfMemory Error

I was creating EJB's using JBuilder and came up with this error. I realize that I am out of memory in my jvm but not sure how to correct the problem. I am using the JDK that was packaged with JBuilder. Any assistance appreciated.
[244 byte] By [rjkimme] at [2007-9-26 4:04:03]
# 1
optimization and performancereuse of object, when you are done with an Object set to null, etc...
jef06 at 2007-6-29 13:02:09 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2
Most web server type applications will end up eating a lot of memory so you should start by increasing the upper limit on the heap via one of the java commnd line X switches.However, that won't help if you have a memory leak.
jschell at 2007-6-29 13:02:09 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 3

Try increasing the default memory allocated to the virtual machine.

If you are using JBuilder, edit the Project Properties dialog, and select the "Run" tab.

On the VM Parameters line, add

-mx512m

this will increase the memory available to slightly more than 512 m. Hopefully you have enough ram/swap space to do this. the -mx XXX m switch is a general jvm switch to handle memory.

(lack of available memory on your machine may really be the problem. If you are on windows, check the task manager, on unix use top)

jeffmathis at 2007-6-29 13:02:09 > top of Java-index,Java HotSpot Virtual Machine,Specifications...