JAVA_OPTIONS="-Xms1024m -Xmx3072 -XX:+UseG1GC -Xloggc:/home/weblogic/products/domain/gclog/gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/weblogic/products/doming/oom"
Copy the code
Weblogic is similar to Tomcat in that it can directly configure JVM parameters and operate on the JVM without following the normal configuration of middleware scripts. Of course, there are some problems with this configuration, but webLogic that does not do clustering and other operations does not need to worry about those problems.
In the webLogic domain, go to the bin directory, find setDomainenv.sh, and add the above line of arguments (at the top).
In tomcat, add JAVA_OPTS=” “to the top of catalina.sh.
This line of arguments is not a middleware argument, but a JVM argument, so no matter what middleware is using the corresponding JDK-JVM, it will not change.
The minimum memory is 1024 MB and the maximum memory is 3072 MB. Weblogic recommends that the maximum and minimum memory Settings be the same. UseG1GC indicates the use of G1 garbage collector. -xloggc indicates the log file address for each gc. HeapDumpOnOut… An overflow snapshot is taken when a memory overflow error occurs, facilitating error analysis.