码迷,mamicode.com
首页 > 编程语言 > 详细

Confluence 提高Java虚拟机内存

时间:2018-11-26 15:10:32      阅读:306      评论:0      收藏:0      [点我收藏+]

标签:tla   RoCE   web   java版本   cto   set   default   work   final   

Confluence 提高Java虚拟机内存

版本

系统:CentOS release 6.8 (Final)
Java版本:1.8.0_162
Confluence版本:6.8.5

问题描述

confluence内存使用率的配置都是默认的,相对会比较低,可以根据实际server的配置情况,升级内存。
通过“右上角配置 --> 一般配置 --> 系统信息”查看
技术分享图片

Linux 提高内存步骤

进入到${confluence}/bin目录下(默认/opt/atlassian/confluence/bin),修改setenv.sh文件

[root@node1 ~]# cd /opt/atlassian/confluence/bin
[root@node1 bin]# cp -a setenv.sh{,_$(date +%F)}
[root@node1 bin]# ll setenv.*
-rw-r--r-- 1 root root 2553 7月  11 04:13 setenv.bat
-rwxr-xr-x 1 root root 3034 11月 26 11:40 setenv.sh
-rwxr-xr-x 1 root root 3034 11月 26 11:40 setenv.sh_2018-11-26
[root@node1 bin]# vim setenv.sh
 62 # Set the JVM arguments used to start Confluence. For a description of the options, see
 63 # http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html
 64 CATALINA_OPTS="-XX:-PrintGCDetails -XX:+PrintGCDateStamps -XX:-PrintTenuringDistribution ${CATALINA_OPTS}"
 65 CATALINA_OPTS="-Xloggc:$LOGBASEABS/logs/gc-`date +%F_%H-%M-%S`.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=2M ${CATALINA_OPTS}"
 66 CATALINA_OPTS="-XX:G1ReservePercent=20 ${CATALINA_OPTS}"
 67 CATALINA_OPTS="-Djava.awt.headless=true ${CATALINA_OPTS}"
 68 CATALINA_OPTS="-Datlassian.plugins.enable.wait=300 ${CATALINA_OPTS}"
 69 CATALINA_OPTS="-Xms1024m -Xmx1024m -XX:+UseG1GC ${CATALINA_OPTS}"
 70 CATALINA_OPTS="-Dsynchrony.enable.xhr.fallback=true ${CATALINA_OPTS}"
 71 CATALINA_OPTS="-Dorg.apache.tomcat.websocket.DEFAULT_BUFFER_SIZE=32768 ${CATALINA_OPTS}"
 72 CATALINA_OPTS="${START_CONFLUENCE_JAVA_OPTS} ${CATALINA_OPTS}"
 73 CATALINA_OPTS="-Dconfluence.context.path=${CONFLUENCE_CONTEXT_PATH} ${CATALINA_OPTS}"
 74 CATALINA_OPTS="-XX:ReservedCodeCacheSize=256m -XX:+UseCodeCacheFlushing ${CATALINA_OPTS}"
 75 
 76 
 77 export CATALINA_OPTS

把69行的-Xmx1024m参数改为自己要求的最大内存,例如:-Xmx3072m

 69 CATALINA_OPTS="-Xms1024m -Xmx3072m -XX:+UseG1GC ${CATALINA_OPTS}"

重启 confluence(需要管理员权限)

# 关闭服务
service confluence stop

# 启动服务
service confluence start  

查看confluence内存配置是否生效。
技术分享图片

Windows 提高内存步骤

进入到${confluence}\bin目录下(默认C:\Atlassian\Confluence\bin),修改setenv.bat文件

 62 # Set the JVM arguments used to start Confluence. For a description of the options, see
 63 # http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html
 64 CATALINA_OPTS="-XX:-PrintGCDetails -XX:+PrintGCDateStamps -XX:-PrintTenuringDistribution ${CATALINA_OPTS}"
 65 CATALINA_OPTS="-Xloggc:$LOGBASEABS/logs/gc-`date +%F_%H-%M-%S`.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=2M ${CATALINA_OPTS}"
 66 CATALINA_OPTS="-XX:G1ReservePercent=20 ${CATALINA_OPTS}"
 67 CATALINA_OPTS="-Djava.awt.headless=true ${CATALINA_OPTS}"
 68 CATALINA_OPTS="-Datlassian.plugins.enable.wait=300 ${CATALINA_OPTS}"
 69 CATALINA_OPTS="-Xms1024m -Xmx1024m -XX:+UseG1GC ${CATALINA_OPTS}"
 70 CATALINA_OPTS="-Dsynchrony.enable.xhr.fallback=true ${CATALINA_OPTS}"
 71 CATALINA_OPTS="-Dorg.apache.tomcat.websocket.DEFAULT_BUFFER_SIZE=32768 ${CATALINA_OPTS}"
 72 CATALINA_OPTS="${START_CONFLUENCE_JAVA_OPTS} ${CATALINA_OPTS}"
 73 CATALINA_OPTS="-Dconfluence.context.path=${CONFLUENCE_CONTEXT_PATH} ${CATALINA_OPTS}"
 74 CATALINA_OPTS="-XX:ReservedCodeCacheSize=256m -XX:+UseCodeCacheFlushing ${CATALINA_OPTS}"
 75 
 76 
 77 export CATALINA_OPTS

把69行的-Xmx1024m参数改为自己要求的最大内存,例如:-Xmx3072m

 69 CATALINA_OPTS="-Xms1024m -Xmx3072m -XX:+UseG1GC ${CATALINA_OPTS}"

重启 confluence(需要管理员权限)

进入到服务管理的界面(我的电脑->右键->管理->服务=====或者=====services.msc)找到confluence的服务,在这里启动关闭服务。

查看confluence内存配置是否生效。

Confluence 提高Java虚拟机内存

标签:tla   RoCE   web   java版本   cto   set   default   work   final   

原文地址:http://blog.51cto.com/moerjinrong/2322014

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!