Fork me on GitHub
#shadow-cljs
<
2023-04-10
>
Jakub Šťastný22:04:05

By the way what HW do you guys use for working on front-end apps? I used to be on 1GB free Oracle VM when on Ruby/Vim and it worked (over Mosh, I just worked on my iPad Pro and it worked like a charm, it was plain Ruby though, with Rails 2 GB were highly desirable and swap was enabled). Now only Java that I start with ShadowCLJS takes over 800MB. I also found myself challenged for horizontal space: given I'm on 13" MB Air with a large font, 120 characters is basically my whole screen. So what do you guys use in terms of: • RAM??? • Monitor(s?)? 13" is really insufficient when it comes to Chrome Web Dev Tools as well :/ • Any other HW info that could be interesting. Additionally any info about how much demanding it gets when the app gets bigger is welcome, I have very little at this point and it's already very resource demanding and I have M2 MB Air which is a very fast chip (but with 8GB MEM, that's definitely an issue there).

thheller06:04:09

You can constrain the memory shadow-cljs uses, the default settings often use more than actually needed. It likely runs fine with 512mb. With shadow-cljs.edn you can set :jvm-opts ["-Xmx512M"], or the equiv in deps.edn or project.clj if you use those

👍 2
thheller06:04:38

I myself just upgraded my pc, so it is pretty fast. Intel i9-13900K, 32gb ram, fast m2 ssd, etc. 2 2560x1440 monitors. still doesn't feel fast enough, but way faster than the 5 year old machine I had before. m2 chip is definitely fast enough, but you are correct memory is the issue.

thheller06:04:58

32gb is fine and usually has more than 8 to spare 😉

Jakub Šťastný16:04:55

Man you can launch rockets into space with such a badass machine. You have 8 GBs to spare I have 8 GB, full stop 😄

Jakub Šťastný16:04:40

@U05224H0W Anyway I wanted to ask, how does ShadowCLJS behaves with these jvm-opts if you give it way too little memory? Would it constrain it at any cost (even crashing) or would it just take the bare minimum?

Jakub Šťastný16:04:23

; deps.edn
+ :aliases {:cljs {:jvm-opts ["-Xmx256M"]}}

; shadow-cljs.edn
+  {:deps {:aliases [:cljs]}

Jakub Šťastný16:04:23

It's still taking 480 MB of RAM. It feels like a lot (I'm not used to JVM quite yet!), but then again I suppose that's as good as it gets?

thheller16:04:51

I never did any tests regarding memory use. I don't know how much the minimum is. you'll start seeing error messages if its too low I presume, never tested

Jakub Šťastný16:04:59

OK I'll keep an eye on it. Now it's 500MB+ and it's a really basic reagent app.

thheller17:04:16

that seems like the memory setting didn'y apply correctly?

thheller17:04:20

it shouldn't go over the limit

thheller17:04:51

did you restart shadow-cljs after making the change?

Jakub Šťastný17:04:06

Of course I restarted.

Jakub Šťastný17:04:31

It's taking 300MB less memory now at least so far.

Jakub Šťastný17:04:16

I'm running it by npx shadow-cljs watch app, not sure whether it's relevant.

thheller17:04:37

thats fine, just that there could be a running server. make sure it doesn't say "connected to server" when you start shadow-cljs