By: Vitalii Bendyna user 13 Jun 2017 at 8:32 a.m. CDT

4 Responses
Vitalii Bendyna gravatar
Hello! First fresh installation of Gluu server 3.0.1: During this installation I used AWS t2.medium instance (2 CPU, 4 GB RAM) and gave to the server 3 GB of RAM. After installation system said that it has 7% free memory. After 4 hours of running application (without requests, without configuration, just stand-by mode) it ran out of the memory and the application went down. The second fresh installation: I've increased AWS instance type to t2.large (2 CPU, 8 Gb RAM) and during installation I've increased memory size given to the server to 6 Gb. But now I see the same situation: free memory is decreasing without any work, just in stand-by status. 2 hours ago I had 39% of free memory and now I have 34% of free RAM. Can someone suggest me what is going on? Installation was the same as in your manual. Instance has been tuned as well as described in your manual. Ubuntu 16.04. Thank you in advice.

By Mohib Zico Account Admin 13 Jun 2017 at 8:47 a.m. CDT

Mohib Zico gravatar
Can you please check which process is eating memory?

By Vitalii Bendyna user 13 Jun 2017 at 9:53 a.m. CDT

Vitalii Bendyna gravatar
Hey! Java is eating memory :) Output of "top" command, sorted by memory: ``` PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 3290 998 20 0 5276472 1.545g 21560 S 0.0 19.8 0:46.61 java 3559 998 20 0 4751644 1.216g 24380 S 0.3 15.6 1:05.52 java 3390 998 20 0 4240216 958184 21052 S 0.0 11.7 0:23.42 java 3221 998 20 0 3192664 772132 20736 S 0.0 9.4 0:23.18 java 3477 998 20 0 3654680 747276 21180 S 0.0 9.1 0:21.80 java ``` All memory used for Java: ``` $ ps aux | grep java | awk '{sum=sum+$6}; END {print sum/1024 " MB"}' 5248.3 MB ``` Java processes: ``` $ ps aux | grep java 998 3221 0.2 9.4 3192664 772268 ? Sl 11:38 0:23 /opt/jre/bin/java -server -Xms256m -Xmx512m -XX:+DisableExplicitGC -Dgluu.base=/etc/gluu -Dcatalina.base=/opt/gluu/jetty/oxauth-rp -Djetty.logging.dir=/opt/gluu/jetty/oxauth-rp/logs -Djetty.home=/opt/jetty -Djetty.base=/opt/gluu/jetty/oxauth-rp -Djava.io.tmpdir=/opt/jetty-9.3/temp -jar /opt/jetty/start.jar jetty.http.host=localhost jetty.http.port=8085 jetty.state=/opt/gluu/jetty/oxauth-rp/oxauth-rp.state jetty-logging.xml jetty-started.xml start-log-file=/opt/gluu/jetty/oxauth-rp/logs/start.log 998 3290 0.4 19.8 5276472 1620552 ? Sl 11:38 0:46 /opt/jre/bin/java -server -Xms256m -Xmx2048m -XX:+DisableExplicitGC -Dgluu.base=/etc/gluu -Dpython.home=/opt/jython -Dcatalina.base=/opt/gluu/jetty/oxauth -Djetty.logging.dir=/opt/gluu/jetty/oxauth/logs -Djetty.home=/opt/jetty -Djetty.base=/opt/gluu/jetty/oxauth -Djava.io.tmpdir=/opt/jetty-9.3/temp -jar /opt/jetty/start.jar jetty.http.host=localhost jetty.http.port=8081 jetty.state=/opt/gluu/jetty/oxauth/oxauth.state jetty-logging.xml jetty-started.xml start-log-file=/opt/gluu/jetty/oxauth/logs/start.log 998 3390 0.2 11.7 4242264 958184 ? Sl 11:38 0:23 /opt/jre/bin/java -server -Xms256m -Xmx1024m -XX:+DisableExplicitGC -Dgluu.base=/etc/gluu -Dcatalina.base=/opt/gluu/jetty/idp -Djetty.logging.dir=/opt/gluu/jetty/idp/logs -Djetty.home=/opt/jetty -Djetty.base=/opt/gluu/jetty/idp -Djava.io.tmpdir=/opt/jetty-9.3/temp -jar /opt/jetty/start.jar jetty.http.host=localhost jetty.http.port=8086 jetty.state=/opt/gluu/jetty/idp/idp.state jetty-logging.xml jetty-started.xml start-log-file=/opt/gluu/jetty/idp/logs/start.log 998 3477 0.1 9.1 3654680 747276 ? Sl 11:39 0:21 /opt/jre/bin/java -server -Xms256m -Xmx683m -XX:+DisableExplicitGC -Dgluu.base=/etc/gluu -Dcatalina.base=/opt/gluu/jetty/asimba -Djetty.logging.dir=/opt/gluu/jetty/asimba/logs -Djetty.home=/opt/jetty -Djetty.base=/opt/gluu/jetty/asimba -Djava.io.tmpdir=/opt/jetty-9.3/temp -jar /opt/jetty/start.jar jetty.http.host=localhost jetty.http.port=8084 jetty.state=/opt/gluu/jetty/asimba/asimba.state jetty-logging.xml jetty-started.xml start-log-file=/opt/gluu/jetty/asimba/logs/start.log 998 3559 0.5 15.6 4751644 1275180 ? Sl 11:39 1:05 /opt/jre/bin/java -server -Xms256m -Xmx1365m -XX:+DisableExplicitGC -Dgluu.base=/etc/gluu -Dcatalina.base=/opt/gluu/jetty/identity -Dpython.home=/opt/jython -Dorg.eclipse.jetty.server.Request.maxFormContentSize=50000000 -Djetty.logging.dir=/opt/gluu/jetty/identity/logs -Djetty.home=/opt/jetty -Djetty.base=/opt/gluu/jetty/identity -Djava.io.tmpdir=/opt/jetty-9.3/temp -jar /opt/jetty/start.jar jetty.http.host=localhost jetty.http.port=8082 jetty.state=/opt/gluu/jetty/identity/identity.state jetty-logging.xml jetty-started.xml start-log-file=/opt/gluu/jetty/identity/logs/start.log ubuntu 29703 0.0 0.0 12944 944 pts/0 S+ 14:50 0:00 grep --color=auto java ```

By Vitalii Bendyna user 14 Jun 2017 at 2:36 a.m. CDT

Vitalii Bendyna gravatar
After 19 hours of running server, it has eaten more then 15% of RAM out of 6 Gb!

By Mohib Zico Account Admin 14 Jun 2017 at 5:08 a.m. CDT

Mohib Zico gravatar
I think you don't need to worry about how much memory is 'consumed' until and unless your server starts crashing. With a perfectly optimal server, you will see 80~85% memory is being consumed all the time with resources. Anyways... you can specifically allocate JVM memory if you want for each component in Gluu Server. They are inside `/etc/default/` of Gluu-Server container. After adding these configuration, you need to restart your Gluu Server container. To give you a quick example... here is how it might looks like: ``` GLUU.[root@idp default]# pwd /etc/default GLUU.[root@idp default]# cat identity JAVA_HOME=/opt/jre JAVA=$JAVA_HOME/bin/java JAVA_OPTIONS="-server -Xms256m -XX:MaxMetaspaceSize=1000m -XX:+DisableExplicitGC -Dgluu.base=/etc/gluu -Dcatalina.base=/opt/gluu/jetty/identity -Dpython.home=/opt/jython -Dorg.eclipse.jetty.server.Request.maxFormContentSize=50000000" JETTY_HOME=/opt/jetty JETTY_BASE=/opt/gluu/jetty/identity JETTY_USER=jetty JETTY_ARGS="jetty.http.host=localhost jetty.http.port=8082" TMPDIR=/opt/jetty-9.3/temp export PYTHON_HOME=/opt/jython GLUU.[root@idp default]# ```