Confluence becomes unresponsive after some time
Asked by Jan Markowski:

We are just trying out confluence and have version 5.8.5 installed using the internal database.

I'm noticing that after some time (not sure what the trigger is exactly), confluence becomes unresponsive from the browser. When I try to access the website, it just sits idle trying to connect the whole time...

However, I've noticed that the instance of java (jdk1.8.0-45), which is exclusively used by confluence, sits there spinning with a VERY HIGH load on the CPU.

The only thing that fixes the problem is if I run the **stop-confluence.sh** and **start-confluence.sh** scripts to fire it up again.

What can I do to fix this?


Answers:
author: Jan Markowski
body: The fix:

In \<confluence-install-dir\>/bin/setenv.sh, I replaced

```
CATALINA_OPTS="-Xms1024m -Xmx1024m -XX:MaxMetaspaceSize=256m -XX:+UseG1GC ${CATALINA_OPTS}"
```

with

```
CATALINA_OPTS="-Xms1024m -Xmx1024m -XX:+UseG1GC ${CATALINA_OPTS}"
```

(i.e. remove the -XX:MaxMetaspaceSize=256m)

Confluence was running fine after that. It's been awhile and I forget how I got to this solution exactly, but probably something I saw in my previous posts' links.


author: Joe Levis
body: Was there a solution found for this?

We're experiencing the same issue on our installation. Although, we're using Confluence 5.8.5, so definitely in need of an upgrade to latest version. Do you know if this was fixed in later releases?


author: Marcel Andres
body: The same happens with verison 5.8.2 and an external database (MS SQL). Most times it is possible to restart the (windows) service but from time to time, restarting the system is required. Increasing the heapsize to Xms - 1024m and Xmx - 1024m did not solve the problem.


author: Jan Markowski
body: 1. For the **OutOfMemoryError** problem, I'm following the instructions found here: <https://confluence.atlassian.com/display/CONFKB/How+to+fix+out+of+memory+errors+by+increasing+available+memory>  
   to increase the heap memory. I will see if this helps solve the issue.
2. The warnings are benign and are related to the newer version of Tomcat. See the following on how to silence the warnings: <https://confluence.atlassian.com/display/CONFKB/Exessive+WARNING+Cache+Messages+in+catalina.out+for+Confluence+5.8.x>


author: Jan Markowski
body: If it help, I just noticed the following error at the bottom of the **/logs/catalina.out** file:

```
Exception in thread "Timer-0" java.lang.OutOfMemoryError: Metaspace24-Jul-2015 15:19:40.254 SEVERE [http-nio-8090-exec-23] org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun java.lang.OutOfMemoryError: Metaspace
```

I've also noted that this error was preceded with a string of WARNINGs regarding the cache such as the one below:

```
23-Jul-2015 10:32:40.989 WARNING [http-nio-8090-exec-6] org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/template/custom/space-select.vm] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
```

Seems to be a cache memory issue. How do I increase the maximum size of the cache?


Tags: confluence-administration