R studio RAM & CPU usage spikes every time I save script

You could try running an R profile to see if there's some R code being executed in the main session that's causing the lag. Try running:

Rprof("rstudio-trace.Rprof")

Then, work in the IDE for a bit until the lag occurs. After that, call

Rprof(NULL)

and then share the contents of that file, or try interpreting summaryRprof("rstudio-trace.Rprof") to see if anything stands out in there.