Hi, I am not sure JAVA_TOOL_OPTIONS is supported (nor documented) for GAE Java11.. You have a few options: 1/ either move to instance_class: F4 or instance_class: F2
to get bigger instances. Or manually control your entrypoint... I assume you deployed a jar, let's call it myjar.jar the default entrypoint generated is: java -jar myjar.jar You can change it by adding this to your app.yaml: entrypoint: java -XX:MaxRAM=200m -Xmx200m -jar myjar.jar Some more doc at https://cloud.google.com/appengine/docs/standard/java11/runtime#application_startup Hope this helps, Ludo On Wednesday, March 24, 2021 at 10:31:54 AM UTC-7 ra wrote: > Hi, > > I am running in the issue "Exceeded soft memory limit of 256 MB with > 283 MB after servicing 3 requests total. > Consider setting a larger instance class in app.yaml.". > > My app.yaml looks like this: > > ######################################## > runtime: java11 > instance_class: F1 > > env_variables: > JAVA_TOOL_OPTIONS: "-XX:MaxRAM=200m -Xmx200m" > inbound_services: > - warmup > > handlers: > - url: /.* > script: auto > secure: always > redirect_http_response_code: 301 > > automatic_scaling: > min_instances: 1 > max_instances: 2 > > # Connecting to the cloud sql instance via app engine standard needs a > vpc access connector: > # > https://stackoverflow.com/questions/51328359/how-to-connect-to-cloud-sql-mysql-database-from-app-engine > vpc_access_connector: > name: "projects/xxxxlocations/europe-west3/connectors/serverless-connector" > ########################################################################## > > My question now is: How can I tell the java runtime to NOT use more > than the available RAM of the instance? > > Strangely: Anything I set in terms of -Xmx gets discarded and my app > always has a max heap of 127.729664MB. > So it seems my JAVA_TOOL_OPTIONS do not get picked up by the JVM. > > So where does the rest of the memory go? > Or is this "something else" like the serverless connector in the > container that consumes all the memory? > > > Thanks! > > > Raphael > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/55cf6419-9a2b-4fb5-a51d-086d084ade78n%40googlegroups.com.
