I've had great luck with the G1 garbage collector when running lots of JVMs on a single (linux) box. It's different from the default by actually freeing memory back to the OS on a full collection, this would result in lower total memory use thus lower swapping when multiple JVMs are running.
The JVM command line parameter is as follows: -XX:+UseG1GC When using lein, it needs to be in the project profile and additionally the LEIN_JVM_OPTS environment variable to cover both JVMs lein spins up (trampoline notwithstanding). On Mon, Feb 27, 2017 at 12:35 PM Thomas Heller <th.hel...@gmail.com> wrote: > What is the best way to determine the right value for this? I remember > that in the past I had a lot of little Java > > programs running and got a much better performance by limiting memory > usage. > > > > That is not an easy question to answer. If you make it too small your > process may crash with OutOfMemory errors, if you give it just enough it > will constantly be running running garbage collections making your program > slower. So "just right" is very dependent on your program and also on what > else is happening on the machine running it. You can use tools like > JVisualVM or Java Mission Control to better understand your system but that > takes a lot of time and effort. > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.