Closed soasme closed 9 years ago
Hi, thanks for the report! If you have the memory available, you can try a bigger maximum JVM heap size:
BOOT_JVM_OPTIONS="-Xmx4g" boot serve -d target/ watch speak cljs-repl cljs -usO none reload
What java -version
are you on? Also, what does boot -V
report?
java version "1.7.0_10"
4.5% MEM: /usr/bin/java -Xmx4g -jar /usr/local/
% boot -V
BOOT_CLOJURE_VERSION=1.6.0 BOOT_VERSION=2.0.0-pre14
f2e [master●] % BOOT_JVM_OPTIONS="-Xmx4g" boot serve -d target/ watch speak cljs-repl cljs -usO none reload
<< started reload server on ws://localhost:8090 >>
<< started web server on http://127.0.0.1:3000 (serving: target/) >>
Starting file watcher (CTRL-C to quit)...
nREPL server listening: 0.0.0.0:65492
Compiling main.js...
Exception in thread "main"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "main"
:(
Weird!
lein-simpleton is awesome, but uses HTTP stuff built into the JVM that I suspect is leaking memory somehow. I'll rework the serve task later to use run-jetty
and wrap-resource
instead, and we can see if this still happens.
Hi, OK! I was able to reproduce your problems in Java 7 and can suggest a fix. However, if you can, I recommend upgrading to Java 8. Using it I did not experience memory problems.
The thing to try for Java 7 is:
BOOT_JVM_OPTIONS="-XX:MaxPermSize=128m" boot serve -d target/ watch speak cljs-repl cljs -usO none reload
You may also experiment with other BOOT_JVM_OPTIONS
on the JVM Options wiki page.
Let us know how it goes.
Edit - also you should run boot -u
to upgrade your boot; we're at -pre16 now.
It works! Thank you so much.
PS. boot
goes so fast. I'm on pre18 now :)
Great! pre-19
is out btw ;-)
I get the same out of memory error when I clone this repo and run boot dev
. I'm on a mac with 16 gigs of memory, but I'm guessing that doesn't matter since it's a java setting. I'm on java version "1.7.0_51"
. Going to try JDK 8 now.
@mhuebert did you try BOOT_JVM_OPTIONS="-XX:MaxPermSize=128m"
on Java 7 and it didn't help?
In any case it's still a really good idea to upgrade to Java 8.
I tried that, but got this error:
$ BOOT_JVM_OPTIONS="-XX:MaxPermSize=128m" boot serve -d target/ watch speak cljs-repl cljs -usO none reload
Writing boot_cljs_repl.cljs...
<< stopping Jetty... >>
clojure.lang.ExceptionInfo: java.lang.IllegalArgumentException: Unknown option: "-u"
data: {:file
"/var/folders/gk/bxgzz2tn5gs2249f05hkw2jh0000gn/T/boot.user631656520500402001.clj",
:line 13}
java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Unknown option: "-u"
java.lang.IllegalArgumentException: Unknown option: "-u"
boot.core/construct-tasks core.clj: 661
...
clojure.core/apply core.clj: 624
boot.user/eval1000/fn boot.user631656520500402001.clj: 15
clojure.core/binding-conveyor-fn/fn core.clj: 1910
I've upgraded to java 8, and it works now. (For anyone here looking to do the same thing on OSX, I recommend this download page as others I found did not install correctly)
boot-reload seems evil. I have BOOT_JVM_OPTIONS="-Xmx2g -XX:MaxPermSize=1g" and I still hit OOM when reload is in my boot chain along with the repl. Drop either of those and the problem disappears. This is on Oracle java 1.7.0_10 also. Trying 8.
boot serve
raise Exception: