ngoel2
(Neha Goel)
April 27, 2016, 7:48pm
1
We are setting up an Android client that communicates with an OpenMRS server using the RESTful API with basic authorization. We have a php middle layer that parses the REST calls from the client to a format that’s compatible with OpenMRS’s rest services module. Every time a REST call is made and a new session is automatically created. When the sessions exceed 10, we get an Out of Memory Error.
We also haven’t been able to get the jsessionid token to work using php.
We’ve already tried all the suggestions in:
https://wiki.openmrs.org/display/docs/Performance+Tuning
Platform version: 1.11.5
How do we fix this? Thanks in advance.
pascal
(Pascal Brandt)
April 27, 2016, 7:54pm
3
What exactly is the Out of Memory Error you are seeing? The JVM memory settings are controlled by these JVM parameters:
-Xmx512m -Xms512m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:NewSize=128m
What are the values you are using for those parameters? What is the output in the Memory Information section on the System Info page ?
eeggert1
(Emily E)
April 27, 2016, 10:34pm
4
We are using the following parameters:
-Xmx512m -Xms512m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:NewSize=128m
Memory Information
Name Value
Total Memory 123 MB
Free Memory 2 MB
Maximum Heap Size 123 MB
pascal
(Pascal Brandt)
April 27, 2016, 10:41pm
5
The arguments are not correctly being passed to the JVM. How exactly are you starting Tomcat and where are you specifying the arguments?
eeggert1
(Emily E)
April 27, 2016, 11:09pm
6
I’m specifying the parameters in /etc/default/tomcat6 as:
JAVA_OPTS="-Djava.awt.headless=true -Xmx512m -Xms512m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:NewSize=128m -XX:+UseConcMarkSweepGC"
and starting Tomcat with:
sudo service tomcat6 start
pascal
(Pascal Brandt)
April 27, 2016, 11:23pm
7
You could try adding:
export JAVA_OPTS="-Djava.awt.headless=true -Xmx512m -Xms512m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:NewSize=128m -XX:+UseConcMarkSweepGC"
to /usr/share/tomcat6/bin/setenv.sh
and restarting Tomcat.
1 Like
eeggert1
(Emily E)
April 27, 2016, 11:55pm
8
Ah. That worked!
Memory Information
Name Value
Total Memory 494 MB
Free Memory 268 MB
Maximum Heap Size 494 MB
Thanks!
1 Like