JBoss WildFly 15.0.1 Final不在2 GB的ubuntu 14.04 vServer上启动:JRE的内存不足

问题描述 投票:0回答:1

我正在尝试使JBoss WildFly 15.0.1 Final在相当小的ubuntu 14.04 vServer上启动。服务器仅具有2 GB的RAM。

我尝试多次启动WildFly均未成功。 JVM似乎需要比我期望的要多得多的RAM。

这是控制台输出:

root@t2g55:~# service wildfly start
 * Starting WildFly Application Server wildfly
 * WildFly Application Server failed to start within the timeout allowed.



root@t2g55:~# cat /var/log/wildfly/console.log
=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /opt/wildfly

  JAVA: /usr/bin/java

  JAVA_OPTS:  -server -Xms768m -Xmx1536m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true

=========================================================================

OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000a0000000, 536870912, 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 536870912 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /opt/wildfly-15.0.1.Final/hs_err_pid1379.log
1379


root@t2g55:~# free
             total       used       free     shared    buffers     cached
Mem:       2097152     258748    1838404         64          0      38644
-/+ buffers/cache:     220104    1877048
Swap:      2097152          0    2097152


root@t2g55:~# java -version
openjdk version "1.8.0_222"
OpenJDK Runtime Environment (build 1.8.0_222-8u222-b10-1~14.04-b10)
OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)


root@t2g55:~#

您可以看到我指定了JAVA_OPTS: -server -Xms768m -Xmx1536m ...,我认为这足以启动WildFly服务器。请不要,standalone.xml已为MySQL DB定义了数据源。

这里是转储.log的开始:

root@t2g55:~# cat /opt/wildfly-15.0.1.Final/hs_err_pid1379.log
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 536870912 bytes for committing reserved memory.
# Possible reasons:
#   The system is out of physical RAM or swap space
#   The process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap
# Possible solutions:
#   Reduce memory load on the system
#   Increase physical memory or swap space
#   Check if swap backing store is full
#   Decrease Java heap size (-Xmx/-Xms)
#   Decrease number of Java threads
#   Decrease Java thread stack sizes (-Xss)
#   Set larger code cache with -XX:ReservedCodeCacheSize=
# This output file may be truncated or incomplete.
#
#  Out of Memory Error (os_linux.cpp:2757), pid=1379, tid=0x00007f62486c6700
#
# JRE version:  (8.0_222-b10) (build )
# Java VM: OpenJDK 64-Bit Server VM (25.222-b10 mixed mode linux-amd64 compressed oops)
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#

---------------  T H R E A D  ---------------
.
.
.

问题

可以用这么多的内存来解决吗,还是我的RAM太少了?我还能尝试什么?

我真的不希望我的提供者先后跟上记忆,只是发现Java,JVM或其他任何问题...

谢谢

编辑1:

vServer提供程序使用OpenVZ进行虚拟化。

信息:他们只是将我推送到4GB,然后有一次,我启动并运行了JBoss。重新启动后,WildFly再次拒绝启动:同一件事,没有足够的内存(即使我在Java 8和Java 11运行时之间切换)。

CMD启动JBoss WildFly:sh /opt/wildfly/bin/standalone.sh &,standalone.xml似乎正常。我删除了ExampleDS,对三个条目进行了评论。

wildfly ubuntu-14.04 heap openvz wildfly-15
1个回答
0
投票

确实是OpenVZ的服务器虚拟化问题。

语录(德语):

嗨,在user_beancounters上出现问题,在privvmpages上出现问题,> zu gering eingestellt。https://wiki.openvz.org/UBC_secondary_parameters#privvmpages

Mit freundlichenGrüßen

X先生

翻译:

嗨,问题出在user_beancounters,也就是privvmpages,这些设置太低了。https://wiki.openvz.org/UBC_secondary_parameters#privvmpages

最诚挚的问候

X先生

我不知道他到底做了什么,但是解决了。

我现在在2GB的计算机上运行,​​没有任何问题,mysqld + standalone.sh(WildFly + webapp)的内存使用约为800 MB。

© www.soinside.com 2019 - 2024. All rights reserved.