everyone:
My service occured OOM Exception very often,the error message like this:
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00007f3f6e360000, 65536, 1) 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 65536 bytes for committing reserved memory.
My server's JDK version:
java -version
openjdk version "1.8.0_121"
OpenJDK Runtime Environment (build 1.8.0_121-8u121-b13-0ubuntu1.16.04.2-b13)
OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)
My server's memory info:
free -m
total used free shared buff/cache available
Mem: 3951 515 3107 0 328 3197
Swap: 4095 1067 3028
my service's start shell is like this:
nohup java -Xmx2048m -Xms1024m -jar myService.jar >nohup.out &
the service is running ok on my local computer; but when i deploy the service for my cloud server, the error has happend!
my local computer's memory is 4G; my cloud server's memory is also 4G, and swap memory is 4G;
anyone can help me? very very thanks!!!