Large idle memory usage

Hi,
I found that Julia has quite a large memory footprint in my machine, and wanted to ask if it’s normal.
By opening Atom, a Julia process opens, with ~500 MB. When starting julia in the REPL, another process with similar memory usage appears.

  • Why are there two julia processes per Atom session?
  • Is this amount of RAM usage normal?
    I would add that when opening julia in the command line it also takes ~500MB of RAM.
    This is with removing everything from the startup.jl file.

Thanks for your time!
Nimrod

I “only” get about 200MB (Julia 1.1 on Linux), which compares quite poorly to the 40MB an ipython shell uses. This is known, but someone else has to tell you why that is though. Not sure why you get 500MB.

The two julia processes for atom are probably: the one you expect (the one you interact with) and another one running to do clever clever stuff with your code (show help, find where functions are defined etc.)

1 Like

Atom by defaults opens two sessions at startup to have one ready if you restart Julia. It’s called something like boot mode = cycler in the settings. Try to kill Julia in atom and you’ll see that a new session will be ready immediately

3 Likes

Thank you, good to know!

Thanks!
I use Julia 1.0 on Win10 - maybe the difference comes from this.

I am a bit late to the party but from my point of view the issue still remains. I would use Julia in a service-like environment where multiple Julia docker would run simultaneously and thus, this big difference is quite heavy.

I am observing more or less the same with docker container by comparing just the idle REPL.
Julia 1.5.3: ~91 MB
Python 3.9.1: ~ 6 MB

Compared to the previous numbers, there is quite an improvement to Julia 1.1 but it still compares quite poorly.

I am quite new to Julia and hence, I am pretty interested which internals are causing that the memory footprint is that big. Do you know, who could give some more details on this?

1 Like

The memory usage is in part by stuff like BLAS that you can drop if you know how to, and probably mostly about Julia having an excellent optimizing compiler, and the price you pay is more memory use. Interpreted languages, or Python (actually has a compiler now by default, just simpler) inherently use less memory.

On my machine idle Julia 1.6 rc1 takes 0.5% of memory (down from 0.6% for older Julia) and it seems like a good trade-off. This is with 32 GB RAM (I had to downgrade my machine from 128 GB… strangely my Supermicro wouldn’t boot). If you only cared about memory use, you would use older Python2 or even better Perl which has lowest mem (and fastest startup):

$ ps aux |grep julia
pharald+  4098 22.3  0.5 1636904 187208 pts/14 Sl+  19:38   0:01 /home/pharaldsson_sym/julia-1.6.0-rc1/bin/julia --startup-file=no

pharald+  4228 34.8  0.6 749156 203908 pts/14  Sl+  19:41   0:01 /home/pharaldsson_sym/julia-1.5.1/bin/julia --startup-file=n

pharald+  4269  0.2  0.0  27428  8928 pts/14   S+   19:43   0:00 python3

pharald+  4391  0.0  0.0  21060  4576 pts/14   S+   19:48   0:00 perl
1 Like