System Error on 1st launch
Asked by ??????? ???????:

Hello,

Using Ubuntu 16.04.06 x86_64. RAM 2 GB

Atlassian-confluence-6.15.7-x64

Installed by execute .bin file.

mysql-connector-java-5.1.48.jar copied to a installation dir /opt/atlassian/confluence/confluence/WEB-INF/lib

Using Java included to Atlassian-confluence-6.15.7-x64

DB MySQL (Database and user created by <https://confluence.atlassian.com/doc/database-setup-for-mysql-128747.html>

After configuring database using URL link (DB test was succesfull) I get an System Error.

Confluence was restarted as a service. I don't see any useful info in atlassian-confluence.log.

In catalina.out i see

OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000e0700000, 105906176, 0) failed; error='Cannot allocate memory' (errno=12)  
#  
# There is insufficient memory for the Java Runtime Environment to continue.  
# Native memory allocation (mmap) failed to map 105906176 bytes for committing reserved memory.

<br />

According to system requirements 2 GB RAM is enough for Confluence with 5 users. DB is empty yet.

#### Stack Trace:\[hide\] {#toc-hId--710689023}

```
com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.IllegalStateException: Spring Application context has not been set	at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:149)	at com.atlassian.util.concurrent.LazyReference.get(LazyReference.java:112)	at com.atlassian.confluence.setup.webwork.ConfluenceXWorkTransactionInterceptor.getTransactionManager(ConfluenceXWorkTransactionInterceptor.java:29)	at com.atlassian.xwork.interceptors.XWorkTransactionInterceptor.intercept(XWorkTransactionInterceptor.java:56)	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)	at com.atlassian.confluence.xwork.SetupIncompleteInterceptor.intercept(SetupIncompleteInterceptor.java:52)	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)	at com.atlassian.confluence.security.interceptors.SecurityHeadersInterceptor.intercept(SecurityHeadersInterceptor.java:39)	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)	at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)	at com.atlassian.confluence.setup.actions.SetupCheckInterceptor.intercept(SetupCheckInterceptor.java:27)	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)	at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:115)	at com.atlassian.confluence.servlet.ConfluenceServletDispatcher.serviceAction(ConfluenceServletDispatcher.java:56)	at com.opensymphony.webwork.dispatcher.ServletDispatcher.service(ServletDispatcher.java:199)	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)	at com.atlassian.confluence.web.filter.DebugFilter.doFilter(DebugFilter.java:46)	at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:32)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)	at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:51)	at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:45)	at com.atlassian.johnson.plugin.servlet.filter.JohnsonServletFilterModuleContainerFilter.doFilter(JohnsonServletFilterModuleContainerFilter.java:50)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)	at com.atlassian.confluence.util.message.MessagesDecoratorFilter.doFilter(MessagesDecoratorFilter.java:64)
```


Answers:
author: Igor M.
body: Hello,

The 2GB requirement is for Confluence process, rather than the server itself. The server itself should have at least 6GB of RAM allocated as per [Hardware guide](https://confluence.atlassian.com/doc/server-hardware-requirements-guide-30736403.html).

Which would result in Confluence heap taking 1GB, Synchrony process taking another 1GB and the rest would be left for your DB service and OS.

Can you confirm how much physical memory you have allocated to the server?

Regards,

Igor

comments: author: ??????? ???????
body: Hello Igor,

20GB

Filesystem Size Used Avail Use% Mounted on  
udev 967M 0 967M 0% /dev  
tmpfs 196M 8.0M 188M 5% /run  
/dev/sda1 19G 8.3G 9.7G 47% /  
tmpfs 976M 0 976M 0% /dev/shm  
tmpfs 5.0M 0 5.0M 0% /run/lock  
tmpfs 976M 0 976M 0% /sys/fs/cgroup  
tmpfs 196M 0 196M 0% /run/user/0


author: Igor M.
body: Thank you, this should be enough for the system to operate, so you just need to make sure that you have at least 6GB of RAM allocated.


author: ??????? ???????
body: Could you tell me, enabling the Swap File can be useful to solve this problem?

Thank you


author: Igor M.
body: It can help in some situations, but swap file would be more useful for overspill not for operations, to prevent the system from crashing when going out of memory, but it's not as efficient or as fast as RAM.


author: ??????? ???????
body: Well, thank you


Tags: confluence-server

server