Fork me on GitHub

@kwladyka I'd try to restrict docker container running on your local host to 60 MB or something like that and see if it still works. When I tried a simple app I couldn't get it work on less than ~130 MB. JVM process consumes much more than just heap memory (see my SO answer with very useful links: - e.g. during startup Clojure apps tend to load lots of classes and thus Metaspace consumption will be likely at least 20-30 MB. I didn't notice if you mentioned what JDK you're using and if you tune heap size - see XX:MaxRAMPercentage in particular (70% as mentioned by @lukaszkorecki is a good value in my experience) To sum up: to run anything in prod I'd give it at least 256 MB of ram

👍 1

yes, I wanted to try also Metaspace limits, BUT I can’t understand why the same image work on my localhost with 128M and not in google cloud run with 128M or even 256M, it needs 512M


Why use XX:MaxRAMPercentage vs let java (new ver. like 11 / 14 / 15) do what it want?


Because otherwise you'll get only 1/4 of RAM as MaxHeap ("Xmx")


Do you mean 1/4 if RAM is default?


What is recommended % as default to start with for clojure?


It's my preference but I think 70% is usually ok - but I haven't used it in environments with such restricted RAM capacity; For me it's always 1+ GB of ram available on the machine.


Do you know how to run my Java app throw some tool which will give me full debug about memory consumption before memory exceed? I mean I want to see something useful. Running app directly gives me nothing, so I could run app by another app (tool) which will log constantly memory usage. But immediately without delay, because memory exceed kill the container. Any idea ?


What is the best solution which you know?