We have selenium based web application developed using spring boot. The server is located as VM Instance at google cloud server.
We have a thread base mechanism usin
The amount of RAM your server has doesn't matter if you don't allocate that memory to your java process.
If you run your application with (any variant of) java -jar command, then add a maximum allowed memory parameter -xmx (check this question). If the application runs inside Tomcat (or any application server), you'll need to increase the maximum allowed memory of it (check its parameters and docs).