3

I have setup heap size for Java:

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

Updated user properties to -Xmx4096m (My Machine RAM is 8 GB)

After changing heap size in control panel, I am changing Heap size in Jmeter.bat to 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
)

Now I am trying to open Jmeter.bat and getting following error

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

Much appreciated that if somebody knows how to resolve this?

ChanGan
  • 4,254
  • 11
  • 74
  • 135
  • Did you try the suggestions https://stackoverflow.com/questions/4401396/could-not-reserve-enough-space-for-object-heap? – Ori Marko Jun 06 '18 at 06:19

1 Answers1

1

Most probably this is due to using 32-bit Java Runtime which cannot allocate more than 2 gigabytes.

Looking into 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.

You can try the following:

  1. Decrease heap size to 1536 MB

  2. According to 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

Community
  • 1
  • 1
Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • My OS: 64 bit and Java: 32 Bit. will it support upto 2GB? – ChanGan Jun 06 '18 at 06:51
  • It **might** be able to allocate 2 GB, however it is not guaranteed. Just migrate to 64-bit Java and you will be able to allocate > 4 GB HEAP to JMeter – Dmitri T Jun 06 '18 at 08:10