I have a script that does a range of things: pull data from SQL server, manipulations using data.table & custom packages, parallel processing using Rcpp, etc. When R is idle & I hold some large data.tables in memory, i type something into the script just to activate the save button, undo the addition, save the script, and suddenly the RAM & CPU usage spikes and eventually settles to something nearly 50% higher. I just also noticed that in fact the CPU & RAM usage spikes as soon as I type into the script! When I do gc(), the RAM returns to previous level. Please let me know what information I should provide to identify the problem. Any help/advice would be greatly appreciated!
I should also say I ran into this problem only recently. I updated R to 3.5, then I reverted back to 3.4 as I couldn't get Rtools to work. Hope this helps.