My 2 cents.
TWS has a large RAM footprint which slows down my VPS.
To mitigate this I do the below:
Keep open applications on my VPS to a minimum. Closing AB, Norgate, Excel etc when not running explorations.
Close TWS screens when not in use eg Trade Log, Account screen etc.
Minimise TWS when idle so it doesn’t need to render any graphics.
Review RAM usage for each application in Windows Task Manager before I disconnect.
You can configure the amount of RAM used by TWS in the TWS config screen under Configure -> General -> Memory Allocation in MB (the default seems to be 768mb). I would be reluctant to reduce this.
I would think 4gb should be enough to run our processes with reasonable performance. If not, you could try a reboot of the VPS which helps with most problems.
Cheers