如何在 Windows 中增加 JVM 运行时内存

pra*_*t22 7 cmd jmeter

我正在尝试通过命令行运行脚本,因为我正在使用以下命令

 C:\apache-jmeter-4.0\apache-jmeter-4.0\bin>jmeter -f -n -t C:\apache-jmeter-4.0\apache-jmeter-4.0\bin\examples\Post_call_24_FirstStep_10.jmx -l C:\apache-jmeter-4.0\apache-jmeter-4.0\bin\examples\CSVDATATest.csv  
Run Code Online (Sandbox Code Playgroud)

但它给出了以下错误

Java HotSpot(TM) Client VM warning: INFO: os::commit_memory(0x05400000, 1073741824, 0) failed; error='The paging file is too small for this operation to complet e' (DOS error/errno=1455)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 1073741824 bytes for Failed 
to commit area from 0x05400000 to 0x45400000 of length 1073741824.
# An error report file with more information is saved as:
# C:\apache-jmeter-4.0\apache-jmeter-4.0\bin\hs_err_pid2076.log
 errorlevel=1 Press any key to continue . . .
Run Code Online (Sandbox Code Playgroud)

Dmi*_*i T 7

根据您收到的错误:

分页文件太小,无法完成此操作

您需要增加虚拟内存(交换文件)的大小,请参阅如何更改 Windows 8 或 Windows Server 2012 上的虚拟内存 (pagefile.sys) 的大小指南以了解更多详细信息。


但是请注意,使用交换会对 JMeter 的性能产生极大的负面影响,因此,如果您耗尽可用的物理 RAM,最好考虑分布式测试- 即在多个主机上运行 JMeter 从机,因为很可能您将无法创建单台机器所需的负载。

参考: