Fork me on GitHub
#docker
<
2020-06-24
>
jumar04:06:47

@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: https://stackoverflow.com/questions/62303368/accounting-for-java-memory-consumption/62307787#62307787) - 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
kwladyka08:06:32

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

kwladyka09:06:34

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

jumar12:06:12

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

kwladyka20:06:53

Do you mean 1/4 if RAM is default?

kwladyka20:06:42

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

jumar03:06:19

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.

kwladyka13:07:34

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 ?

kwladyka13:07:13

What is the best solution which you know?