In my server, I have total 16GB memory. JVM max memory(Xmx)is assigned to 12GB. In JVM, we are running WSO2 ESB. We had set MaxMetaspaceSize=1g
in JVM. That frequently gave us the following error.
java.lang.OutOfMemoryError: Metaspace
Then we removed the MaxMetaspaceSize=1g
parameter from JVM. Then we came up the following two errors in JVM and we experienced slowness in the application as well.
Caused by: java.lang.OutOfMemoryError: Java heap space
Caused by: java.lang.OutOfMemoryError: Required array size too large
What can be a possible solution to get rid of initial Metaspace error?