jboss-cli and java command throwing error for wildfly user

51 views
Skip to first unread message

chandra s

unread,
Jul 25, 2025, 8:04:52 AM7/25/25
to WildFly
We are getting below error while running jboss-cli.sh and java -version with wildfly installed user. Please let us know what is the issue and how to fix it ?

./jboss-cli.sh
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00007f8316192000, 331776, 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 331776 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /wildfly/18.0.1.Final/bin/hs_err_pid570955.log
==========================================

 java -version
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00007fec3c080000, 331776, 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 331776 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /home/<uid>/hs_err_pid570756.log
================================
standalone.conf

JAVA_OPTS="$JAVA_OPTS -Xms3072m -Xmx4096m"

# JVM Performance Settings
JAVA_OPTS="$JAVA_OPTS -XX:MetaspaceSize=128M -XX:MaxMetaspaceSize=512m"

===========================
If I run the same commands with ROOT getting correct information

/wildfly/latest/bin/jboss-cli.sh
You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.
[disconnected /] connect
[standalone@localhost:9990 /]

 java -version
openjdk version "1.8.0_402"
OpenJDK Runtime Environment Corretto-8.402.08.1 (build 1.8.0_402-b08)
OpenJDK 64-Bit Server VM Corretto-8.402.08.1 (build 25.402-b08, mixed mode)

=============
ULIMITS for wildfly user
 ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) 245760
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 61536
max locked memory       (kbytes, -l) unlimited
max memory size         (kbytes, -m) unlimited
open files                      (-n) 2000
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 16384
cpu time               (seconds, -t) unlimited
max user processes              (-u) 61536
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

Ulimits for ROOT
 ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 61536
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 61536
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

James Perkins

unread,
Jul 25, 2025, 12:31:26 PM7/25/25
to WildFly
What version of WildFly are you using?

James Perkins

unread,
Jul 25, 2025, 12:35:12 PM7/25/25
to WildFly
Sorry, just saw it in the path, 18.0.1.Final is the version.

I'm not sure what would cause that. However, if you see the same error with `java -version` then it's likely not an issue with WildFly.

Bartosz Baranowski

unread,
Jul 28, 2025, 5:55:26 AM7/28/25
to WildFly
Define "running"
- is WFLY just up?
- does it have some apps deployed?
- is it under stress?

Also, according to error it seems like it fails to allocate 0.3MB. What is your situation WRT  memory?

chandra s

unread,
Jul 29, 2025, 10:01:53 AM7/29/25
to WildFly
Added JAVA_TOOL_OPTIONS=-Xms64m -Xmx128m for jboss-cli.sh for that user. Then it stopped throwing error.
Reply all
Reply to author
Forward
0 new messages