I have a small program that should perform parallel banking transfer using the STM, so I am testing it on different machines, 2-core and a 1-core. In the 2-core machines everything works, but in the 1-core machine, the Java Out of Memory error is thrown when I perform 1 million parallel transactions.
The error is the following "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
Also I have a Java-synchronize version of the same program which works, even if it is slower, it can reach a million transactions.
What can I do to make my Clojure application work in the 1-core machine? I am afraid the garbage collector can't handle so many Refs...what do you think?
Thanks a lot for your help!
Update:
It works now, I did java -Xmx1000m -jar myprog.jar
and worked perfectly!
I didn't know it was possible to increasing the heap size for the JVM, and that was exactly my problem. Thanks a lot to "sw1nn" for the great comment ;)
You can also add jvm-opts to your leiningen project.clj like below:
:jvm-opts ["-Xmx1500m"]
to get it specified when you run your program in leiningen.(like testing)