标签:count 失败 The 分区 save serve 记录 more help
在启动Tomcat的过程中,tomcat/catalina.out中报出如下故障:
> /opt/govern/wydaas/logs/catalina.out
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 715653120 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /root/hs_err_pid19148.log
> /root/hs_err_pid19148.log
# There is insufficient memory for the Java Runtime Environment to continue. 
# Native memory allocation (mmap) failed to map 715653120 bytes for committing reserved memory.
即
1 JRE/JVM 的内存需求大小:715653120Byte/1024/1024=682.5MB ,但内存空间提供不了这么大,导致应用服务启动失败。
2 说明了JRE(JVM)内存不足,但可以通过增大swap的存储空间来解决。
CentOS7 / x86 / 64bit
[root@hydrant ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:          11903       11358         168          71         376         176
Swap:         16383        8569        7814
[root@hydrant ~]# swapon -s 
文件名                类型        大小    已用    权限
/tmp/mem.swap                              file    4194300    0    -1
/dev/dm-1                              	partition	8388604	8151604	-2
[root@hydrant ~]# cat /proc/swaps
文件名                类型        大小    已用    权限
/tmp/mem.swap                              file    4194300    0    -1
/dev/dm-1                              	partition	8388604	8151604	-2
通过新增swap可临时存储的交换文件来增大swap存储空间
[root@hydrant ~]# dd if=/dev/zero of=/swap01 bs=1M count=8192
记录了8192+0 的读入
记录了8192+0 的写出
8589934592字节(8.6 GB)已复制,87.0453 秒,98.7 MB/秒
把这个文件变成swap文件
[root@hydrant ~]# mkswap /swap01
正在设置交换空间版本 1,大小 = 8388604 KiB
无标签,UUID=36f7531f-eecc-4133-9b14-0ab163c4cb40
启用这个swap文件
[root@hydrant ~]# swapon /swap01
swapon: /swap01:不安全的权限 0644,建议使用 0600。
/swap01    swap    swap    default   0 0
通过新增swap磁盘分区来增大swap
fdisk  /dev/sda
Command (m for help): n
通过n新建分区,选择为主分区,分区ID为82,即swap分区。保存退出。
mkswap /dev/sda4
swapon /dev/swap
/dev/sda4    swap    swap    default   0 0
swapoff /tmp/mem.swap
标签:count 失败 The 分区 save serve 记录 more help
原文地址:https://www.cnblogs.com/johnnyzen/p/13185547.html