Why do I get java.lang.OutOfMemoryError and how do I handle it?

I am developing a standalone application (swings and jdbc) which has extensive interaction with MS Access database. After a few iterations the systems gives OutOfMemory Error and stops. I understand that it is due to JVM unable to provide enough memory space to create more objects.. Could someone let me know as to how I need to handle this?

thanks

[369 byte] By [ggayathric] at [2007-9-26 2:04:31]
# 1
Hi,You can increase the maximum heap size assigned to java by inluding -Xmx in the command line like this:java -Xmx256mb <your_class>You can change 256 (megabytes) to the mamimum heap size your program will allocate.Hope this helps,Kurt.
leukbr at 2007-6-29 8:48:32 > top of Java-index,Archived Forums,Java Programming...
# 2
Thanks kurt..your suggestion works.. But what is the max heap size that one could give. There would be a logical and physical limit to this.. if yes what could be the value for the same?any idea?thanks
ggayathric at 2007-6-29 8:48:32 > top of Java-index,Archived Forums,Java Programming...
# 3
Hi,There is indeed a limit to the VM. I believe it is currently about 1.8 gigs.
leukbr at 2007-6-29 8:48:32 > top of Java-index,Archived Forums,Java Programming...