在命令行上增加 jMeter 的内存 [英] Increase memory for jMeter on command line

查看:34
本文介绍了在命令行上增加 jMeter 的内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Mac 上从命令行运行 jMeter.今天它抛出了内存不足,堆空间错误......

I am running jMeter from the command line on a Mac. Today it threw an Out of memory, heap space error....

newbie$ sh jmeter.sh
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
at java.awt.image.DataBufferInt.<init>(DataBufferInt.java:41)
at java.awt.image.Raster.createPackedRaster(Raster.java:455)

我知道我需要增加分配给它的内存,但不确定如何.我看了这篇文章 无法增加 JMeter 的堆大小在 Mac OSX 上,发现它提到的 bin 文件夹中的 jMeter 脚本文件并进行了以下更新..

I know I need to increase the memory allocated to it, but not sure how. I looked at this post Unable to increase heap size for JMeter on Mac OSX and found that jMeter script file in the bin folder it mentions and made the below updates..

HEAP="-Xms1024m -Xmx2048m"
NEW="-XX:NewSize=512m -XX:MaxNewSize=1024m"

但我仍然遇到内存不足错误.我只需要给它更多还是我在错误的地方改变?难道我需要重新启动我的整个机器?

But I am still getting the out of memory error. Do I just need to give it more or am I changing in the wrong place? Could it be I need to restart my whole machine?

推荐答案

据我所知:

  • 您对 jmeter 脚本进行了更改
  • 您正在启动 jmeter.sh 脚本
  • 您想知道为什么未应用更改?
  • You made changes to jmeter script
  • You're launching jmeter.sh script
  • You want to know why the changes are not applied?

如果您更改了 jmeter 脚本,为什么不将其作为 ./jmeter 启动?

If you changed jmeter script why don't you just launch it as ./jmeter ?

如果您出于任何原因需要通过 jmeter.sh 启动 JMeter,请按如下方式运行:

If you need to start JMeter via jmeter.sh for any reason, run it as follows:

JVM_ARGS="-Xms1024m -Xmx2048m -XX:NewSize=512m -XX:MaxNewSize=1024m"  && export JVM_ARGS && ./jmeter.sh

参见运行JMeter用户手册章节和终极 JMeter 资源列表,一般用于相关文档.

See Running JMeter User Manual chapter in particular and The Ultimate JMeter Resource List in general for the relevant documentation.

这篇关于在命令行上增加 jMeter 的内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆