ruthst00 commented on code in PR #16545: URL: https://github.com/apache/grails-core/pull/16545#discussion_r4209741381
########## grails-doc/src/en/guide/upgrading/upgrading80x.adoc: ########## @@ -4716,3 +4716,26 @@ for template renders: Objects passed with `bean` or `collection` are not part of `model`. See link:theWebLayer.html#definingInterceptors[Defining Interceptors]. + +[[java25-memory-upgrade]] +==== 85. Java 25 Memory Requirements + +**What to do when running on Java 25:** + +Set an explicit metaspace ceiling with `-XX:MaxMetaspaceSize` so the JVM raises `OutOfMemoryError: Metaspace` before the container runtime kills the process: + +[source,bash] +---- +java -Xmx512m -XX:MaxMetaspaceSize=256m -Dgrails.env=prod -jar application.jar +---- + +Or, using percentage-based heap sizing in a container: + +[source,bash] +---- +java -XX:MaxRAMPercentage=60.0 -XX:MaxMetaspaceSize=256m -Dgrails.env=prod -jar application.jar +---- + +Tune `-XX:MaxMetaspaceSize` from a measured baseline: run the application under representative load, observe metaspace usage with `jcmd <pid> VM.metaspace`, and add a safety margin. + +See link:deployment.html#java25-memory[Java 25 Metaspace and Off-Heap Memory] in the deployment guide for full details, including systemd service unit examples and guidance on the metaspace free-ratio flags. Review Comment: Updated in https://github.com/apache/grails-core/pull/16545/changes/4275f141e25b4df26e88717dd880a6a83e5ab212 ########## grails-doc/src/en/guide/deployment/deploymentStandalone.adoc: ########## @@ -45,6 +45,7 @@ java -Xmx768m -Dgrails.env=prod -jar build/libs/myapp-0.1.jar \ This example requires `/etc/myapp/` to exist. Place external `application.yml` or `application.properties` there. Size the heap for your workload and leave memory for metaspace, thread stacks, direct buffers, native libraries, and the operating system. +On Java 25 (and since Java 8), metaspace is unbounded by default; see <<java25-memory,Java 25 Memory Considerations>> for recommended settings. Review Comment: Updated in https://github.com/apache/grails-core/pull/16545/changes/4275f141e25b4df26e88717dd880a6a83e5ab212 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
