jmeter压测前清理内存

本文介绍了解决JMeter在进行性能测试时遇到的高内存占用问题,通过调整JVM参数来提高可用内存,并提供了清理内存的具体命令。


jmeter 压测时设置了内存为
sed -i 's/HEAP="-Xms512m -Xmx512m"/HEAP="-Xms36096m -Xmx360096m"/' jmeter
占了48G内存中的很大一部分
再执行的时候会出现如下提示:Cannot allocate memory


Creating summariser <summary>
Created the tree successfully using multiple.jmx
Starting the test @ Fri Nov 03 09:41:50 CST 2017 (1509673310765)
Waiting for possible Shutdown/StopTestNow/Heapdump message on port 4445
summary + 30347 in 00:00:09 = 3432.5/s Avg: 49 Min: 2 Max: 1161 Err: 0 (0.00%) Active: 449 Started: 449 Finished: 0
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00007ee206000000, 60397977600, 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 60397977600 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /data/apache-jmeter-3.2/bin/hs_err_pid55623.log

需要执行下清理内存的命令:
echo 1 > /proc/sys/vm/drop_caches
就可以重新执行性能测试了

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值