-
Notifications
You must be signed in to change notification settings - Fork 1
Memory Size
David Goldfarb edited this page Aug 24, 2017
·
9 revisions
One way to reduce Clojure's memory usage
export _JAVA_OPTIONS="-Xmx2g"
My development machine is well endowed, with a fast processor, SSD drive, and 32GB of RAM. Nonetheless, it would sometimes grind to a halt when I worked on a ClojureScript project.
The reason was (as is usually the case) disk thrashing. My memory was over-commited. But why?
My machine runs Ubuntu, and typically has running:
- Chrome, with many open tabs.
- A VM running Windows 10.
- Emacs, with many source code buffers, Cider, and two REPLs (one for Clojure and one for ClojureScript.
- A few terminal shells, sometimes running another REPL (e.g., for tests or CSS compilation).
Clojure runs in the Java Virtual Machine (JVM). In my dev setup, I always have at least two JVMs running; sometimes more.