Then the 4G of RAM is the problem. This is not enough to handle the amount of data.
Probably your OS is also still 32Bit? Then it is really not sufficient. If it is already 64Bit, then you can try to tweak the memory settings a bit.
In the ‘etc’ folder of the installation directory of SNAP, you’ll find a file named snap.conf. Open it in a text editor.
There is the line which starts with ‘default_options=’
In this line, you’ll find an option like -J-Xmx2G. Increase the value. You could use something like -J-Xmx3G.