I've a simple Spring Boot application running on Google App Engine Standard Java 11 environment F2 instances. However, I occasionally get errors such as:
Exceeded soft memory limit of 512 MB with 592 MB after servicing 18320 requests total. Consider setting a larger instance class in app.yaml.
Instead of upgrading to a larger instance type, I'd prefer to limit memory usage, even if it degrades performance a bit.
Since an F2 instance has 512MB of available memory, would it help to set JVM's -Xmx option to a value like say, 480MB? Or will it make things worse by converting Google's "Exceeded soft memory limit" warning to a full blown OutOfMemory error?
Thanks