This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-11-06
Channels
- # announcements (5)
- # asami (4)
- # babashka (27)
- # beginners (1)
- # calva (4)
- # cider (64)
- # clj-kondo (7)
- # clojure (7)
- # clojure-brasil (3)
- # clojure-europe (41)
- # clojure-france (2)
- # clojure-norway (101)
- # clojure-uk (5)
- # clojurescript (19)
- # cursive (3)
- # datahike (15)
- # datomic (15)
- # events (2)
- # honeysql (11)
- # hyperfiddle (27)
- # introduce-yourself (2)
- # jobs-rus (1)
- # leiningen (8)
- # london-clojurians (1)
- # lsp (175)
- # off-topic (52)
- # overtone (10)
- # portal (15)
- # re-frame (7)
- # reagent (1)
- # releases (1)
- # remote-jobs (2)
- # shadow-cljs (15)
- # sql (5)
Good morning/afternoon/evening. I'm hitting a weird bug that I don't know where to go on. I have a service that gets packed into an uberjar with lein uberjar
in a Dockerfile
. When I run lein uberjar
from my laptop's terminal all is well. When I run the command inside of docker build
I get an OutOfMemory
exception Java heap space
. The stack trace always looks something like:
102.4 Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
102.4 at clojure.lang.PersistentVector.chunkedSeq(PersistentVector.java:279)
102.4 at clojure.lang.PersistentVector.seq(PersistentVector.java:283)
102.4 at clojure.lang.RT.seqFrom(RT.java:528)
102.4 at clojure.lang.RT.seq(RT.java:523)
102.4 at clojure.lang.RT.first(RT.java:668)
102.4 at clojure.core$first__4339.invokeStatic(core.clj:55)
102.4 at clojure.core$some.invokeStatic(core.clj:2592)
102.4 at clojure.core$some.invoke(core.clj:2583)
102.4 at leiningen.core.pedantic$all_paths$iter__4322__4328$fn__4329.invoke(pedantic.clj:109)
102.4 at clojure.lang.LazySeq.sval(LazySeq.java:40)
102.4 at clojure.lang.LazySeq.seq(LazySeq.java:56)
102.4 at clojure.lang.ChunkedCons.chunkedNext(ChunkedCons.java:59)
102.4 at clojure.lang.ChunkedCons.next(ChunkedCons.java:43)
102.4 at clojure.lang.RT.next(RT.java:688)
102.4 at clojure.core$next__4341.invokeStatic(core.clj:64)
102.4 at clojure.core$dorun.invokeStatic(core.clj:3033)
102.4 at clojure.core$doall.invokeStatic(core.clj:3039)
102.4 at clojure.core$doall.invoke(core.clj:3039)
102.4 at leiningen.core.pedantic$all_paths.invokeStatic(pedantic.clj:113)
102.4 at leiningen.core.pedantic$all_paths.invoke(pedantic.clj:100)
102.4 at leiningen.core.pedantic$transform_graph.invokeStatic(pedantic.clj:123)
102.4 at leiningen.core.pedantic$transform_graph.invoke(pedantic.clj:115)
102.4 at leiningen.core.pedantic$use_transformer$reify__4356.transformGraph(pedantic.clj:161)
102.4 at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:282)
102.4 at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:350)
102.4 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
102.4 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
102.4 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
102.4 at java.base/java.lang.reflect.Method.invoke(Method.java:568)
102.4 at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93)
102.4 at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:28)
102.4 at cemerick.pomegranate.aether$resolve_dependencies_STAR_.invokeStatic(aether.clj:806)
Any ideas on how to debug this? I tried moving the heap up by adding :jvm-opts ["-Xmx8g"]
to my project.clj
. Will that change the java args on the lein process or is there a different way to set that for leiningen? Thanks for the great tool.docker configuration allows you to specify the max number of cores/memory for containers. could you have that configured with less memory than you need?
Good thought. I’ll try tomorrow. Thanks
there's this var as well https://github.com/technomancy/leiningen/blob/24fb93936133bd7fc30c393c127e9e69bb5f2392/sample.project.clj#L546 - often you have to hit that one instead for Lein itself
What version of lein are you using? Lein 2.9.9 fixed a bug that could cause infinite loops and OOM in the leiningen.core.pedantic
code path https://github.com/technomancy/leiningen/releases/tag/2.9.9
Updating lein to the latest, or setting :pedantic? false
in project.clj
would probably help
@UKDTR0QAK interesting, let me see.
I bet that's it. The base docker image that I'm using has lein 2.8.1
. I'll get it upgraded. Thanks!!
That was totally it. Thanks for the help everyone!!