gpt4 book ai didi

java - 当 Jmeter.bat 中的堆大小增加时无法打开 Jmeter?

转载 作者:行者123 更新时间:2023-11-30 10:14:56 25 4
gpt4 key购买 nike

我已经为 Java 设置了堆大小:

Control Panel --> Java (Control panel) --> Java --> View 

将用户属性更新为 -Xmx4096m(我的机器 RAM 是 8 GB)

在控制面板中更改堆大小后,我将 Jmeter.bat 中的堆大小更改为 2048MB。

set HEAP=-Xms2048m -Xmx2048m

if not defined HEAP (
rem See the unix startup file for the rationale of the following parameters,
rem including some tuning recommendations
set HEAP=-Xms512m -Xms512m -XX:MaxMetaspaceSize=512m
)

现在我尝试打开 Jmeter.bat 并收到以下错误

Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
errorlevel=1
Press any key to continue . . .

非常感谢,如果有人知道如何解决这个问题?

最佳答案

这很可能是由于使用 32 位 Java 运行时,它不能分配超过 2 GB 的内存。

调查Frequently Asked Questions About the Java HotSpot VM

Why can't I get a larger heap with the 32-bit JVM?

The maximum theoretical heap limit for the 32-bit JVM is 4G. Due to various additional constraints such as available swap, kernel address space usage, memory fragmentation, and VM overhead, in practice the limit can be much lower. On most modern 32-bit Windows systems the maximum heap size will range from 1.4G to 1.6G.

您可以尝试以下方法:

  1. 将堆大小减少到 1536 MB

  2. 根据 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure

    Java - use the latest 64-bit version of Java SE JDK or Server JRE where possible

关于java - 当 Jmeter.bat 中的堆大小增加时无法打开 Jmeter?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50712948/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com