Crashing of Frappe Instance when using VS Code


I am currently trying to do app development on Frappe using VS Code to debug the code. I have been experiencing system freezes frequently and yesterday, the server became unresponsive totally.

Luckily, when I restarted the server, the system came back. I am using GCP cloud for my Frappe instance.

I was told to look use Top to look at my resource utilisation and I got the following:

When not running anything:

When Bench Start is started:

When VS Code is started:

I am running on a dual core processor with 4 Gb RAM on Ubuntu 20 and Frappe version 13.

The utilisation seems to be very high when VS Code is running (>80% of memory) which I am suspecting is causing the system freezes (which can take minutes up to an hour to recover).

Does anyone have any experience of this or can advise me on the correct minimum hardware requirements to run Frappe and VS Code effectively?

Appreciate any advice. Thank you!