How to lower RAM usage

How do you lower cache of RAM without removing libraries?

1 Like

Hey @Sai-GiridharGi1 could you provide a link to your Repl please? It would help us figure out why your Repl is using a lot of RAM.

2 Likes

RAM stands for random access memory. If your programs is using lots of RAM, that’s an indication you’re using lots of variables and or files and this is taking lots of space. More likely, however, in this case, is that the language server running in your Repl is taking up a lot of this RAM. You can stop it to save some RAM.

3 Likes

If cache memory is still there, it signals that there is enough left for program memory (because program memory takes priority).
To prevent RAM usage being a problem, you could change the priority of the language server processes so they are killed before the program. Run in Shell:

sed -i '/start/s/"/"choom -n 1000 -- /' .replit

(This won’t work well if the language server used uses a lot of memory close to when it starts up)
If you aren’t using “code intelligence” anyhow (you probably are in some way), disable it in Tools > Settings.

5 Likes

Hi. I have just created my account on Replit and just started with it. I have just created a repl and not written any code yet, but it is still showing the RAM usage “at limit”. Why is that so?

1 Like

Hi, @Mitali-13!

Replit’s RAM and CPU counters also take into account background processes and such, not just your code and its output. This can vary based on the language you are using, Java would probably use more than C, you can probably think of other comparisons, and I believe code intelligence also goes into account here.

Don’t worry, you should be fine even with the RAM usage this high, but if you still want more RAM you can upgrade your account or boost your Repl with Cycles.

3 Likes