Linux启动jmeter OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c0000000, 1073741824, 0) failed; error='Cannot allocate memory' (errno=12)
在Linux上安装jdk、jmeter配置好环境后。启动jemter的时候报错。
[root@iZwz9bpj7oo7xbrms4f83hZ ~]# jmeter -v OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c0000000, 1073741824, 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 1073741824 bytes for committing reserved memory. # An error report file with more information is saved as: # /root/hs_err_pid14234.log [root@iZwz9bpj7oo7xbrms4f83hZ ~]#
以上报错是因为服务器内存不足,无法启动所导致。
自查:
1、输入free-m,查看可用内存。
[root@iZwz9bpj7oo7xbrms4f83hZ ~]# free -m total used free shared buff/cache available Mem: 1734 967 87 0 679 583 Swap: 0 0 0
2、查看已启动的服务,停掉部分已启动的进程。(docker部署示例)
[root@iZwz9bpj7oo7xbrms4f83hZ ~]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES a0a7c0766c21 jenkins/jenkins "/sbin/tini -- /usr/…" 2 months ago Up 3 days 0.0.0.0:8080->8080/tcp, 50000/tcp test-jenkins 662c4d4084cf easymock/easymock:1.6.0 "/bin/bash -c 'npm s…" 5 months ago Up 2 minutes 0.0.0.0:7300->7300/tcp easymock_web_1 67d3f0472ceb redis:4.0.6 "docker-entrypoint.s…" 5 months ago Up 3 weeks 6379/tcp easymock_redis_1 8bd33f9f9e01 mongo:3.4.1 "/entrypoint.sh mong…" 5 months ago Up 3 weeks 27017/tcp easymock_mongodb_1 e3fc7fef7737 hrun_web:1.0 "python manage.py ru…" 5 months ago Up 3 weeks 0.0.0.0:8000->8000/tcp hrun_web c2774cdd6447 mysql:5.7 "docker-entrypoint.s…" 5 months ago Up 3 days 33060/tcp, 0.0.0.0:3309->3306/tcp
停掉一个服务
[root@iZwz9bpj7oo7xbrms4f83hZ ~]# docker stop 67d3f0472ceb 8bd33f9f9e01 67d3f0472ceb 8bd33f9f9e01
3、再查看内存空间
[root@iZwz9bpj7oo7xbrms4f83hZ ~]# free -m total used free shared buff/cache available Mem: 1734 557 467 0 710 996 Swap: 0 0 0
4、再启动jmeter
[root@iZwz9bpj7oo7xbrms4f83hZ ~]# jmeter -v _ ____ _ ____ _ _ _____ _ __ __ _____ _____ _____ ____ / \ | _ \ / \ / ___| | | | ____| | | \/ | ____|_ _| ____| _ \ / _ \ | |_) / _ \| | | |_| | _| _ | | |\/| | _| | | | _| | |_) | / ___ \| __/ ___ \ |___| _ | |___ | |_| | | | | |___ | | | |___| _ < /_/ \_\_| /_/ \_\____|_| |_|_____| \___/|_| |_|_____| |_| |_____|_| \_\ 5.1.1 r1855137 Copyright (c) 1999-2019 The Apache Software Foundation