Excess RAM usage

Whenever I run an infinite loop on VS Code or either code OSS , at first it limits its RAM usage below 700 Mib but after like 10 secs it shoots up till my system runs low on memory and the editor crashes.

well its expected behavior
as you run an infinite loop it will use lot of ram
and it will run untill you are out of memory then it will cause you to freeze entire system
then only reboot is option
but what we do is we use nohang
its a oom prevention daemon
it kills the program responsible for oom saving the system from freezing
so thats why your ide crashed

5 Likes

You could also set resource limits on your processes, allowing the OS to kill them, however, unless done carefully, you will shoot yourself in the foot with this.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.