soapUI-JVM-Maximum-Heap-Size-Issue-[Resolution]

In my last article I talked about testing Web Services using a fantastic tool – soapUI.

As I mentioned there, soapUI is a very useful tool and that is the reason I use it very often.

While using it recently, I came across an issue because of which I couldn’t launch it on my machine!

Clicking on the soapUI.exe, I got soapUI JVM maximum heap size (-Xmx) error message which read something like this.

The JVM could not be started. The maximum heap size (-Xmx) might be too large or an antivirus or firmware tool could block the execution.

I tried different things and while looking for a solution on the internet, found a rather simple solution to this issue which I wanted to share with you.

Before I jump on to the fix for this issue, here is a brief on what exactly is ‘maximum heap size’

What does Heap Size in Java mean?

When any Java program launches on your machine, Java Virtual Machine (or JVM) takes some memory from the Operating System.

Then, for as long as the program runs, JVM uses this allocated memory for its operation and a part of this memory is termed Java Heap Memory.

So, when ever a new object is created for a Java Application (which happens in this case when you launch soapUI.exe!), it is allocated memory from Heap and when object dies or garbage is collected, memory goes back to Heap.

-Xms denotes starting size of heap while -Xmx denotes maximum size of heap in Java.

How to fix soapUI JVM maximum heap size issue?

Java maximum heap size (-Xmx) error occurs because Soap UI tries to fetch the specified amount of memory in form of single block which is not available and hence, this error.

Now that you understand what Java maximum heap memory size is and what is the reason behind this error in soapUI, let’s jump on to the solution to this problem!

1. Navigate to “C:\Program Files\SmartBear\soapUI-x.x.x\bin” on your system and look for the file soapUI-x.x.x.vmoptions.

x.x.x refers to the soapUI version you are using!

In my case, this is how the navigation path is (on Windows 7). But, it won’t make much of a difference if you are using any other version of Windows.

soapUI Java Heap Memory Issue - soapUI-4.5.2.vmoptions

2. Now, right-click on this file and open it in any text editor – Notepad or Notepad++. Personally, I prefer Notepad++; we will discuss the reasons in some future post!

soapUI Java Heap Size Issue - edit soapUI-4.5.2.vmoptions

Once you open it,  below is how the contents of this file looks like:

-Xms128m
-Xmx1000m
-Dsoapui.properties=soapui.properties
-Dsoapui.home=C:\Program Files (x86)\SmartBear\soapUI-4.5.2/bin
-Dsoapui.ext.libraries=C:\Program Files (x86)\SmartBear\soapUI-4.5.2/bin/ext
-Dsoapui.ext.listeners=C:\Program Files (x86)\SmartBear\soapUI-4.5.2/bin/listeners
-Dsoapui.ext.actions=C:\Program Files (x86)\SmartBear\soapUI-4.5.2/bin/actions
-Dwsi.dir=C:\Program Files (x86)\SmartBear\soapUI-4.5.2/wsi-test-tools
-Djava.library.path=C:\Program Files (x86)\SmartBear\soapUI-4.5.2/bin
-Djava.util.Arrays.useLegacyMergeSort=true
-Djxbrowser.xulrunner.dir=C:\Program Files (x86)\SmartBear\soapUI-4.5.2\.JxBrowser

In this file, change the -Xmx to a smaller value like 512m. If it still doesn’t work, change it change it to an even lesser value to suit your requirement.

3. Now save the file soapUI-x.x.x.vmoptions and re-launch soapUI.exe.


Update (21 Sep 2015): One of our readers (Afrin) faced the same issue with SeeTestManual which he reported in the comment below!

SeeTestManual by Experitest is a manual testing tool for iOS, Android, WindowsPhone and Blackberry.

To fix JVM could not be started – maximum heap size memory issue in SeeTestManual, you can follow the simple steps as described below to increase JVM memory size.

1. Create a new .txt file and add the text “-Xmx<SIZE>” in it.
[For example, to increase the memory to 1024m, use “-Xmx1024m” (this will set the memory value to 1024mb)]

2. Save the file with the name as studio.vmoptions. When trying to save it, you will be prompted to confirm the file extension name – Approve it!

3. Place the file into the folder where you installed SeeTestManual (The same directory where studio.exe is located)

4. Relaunch SeeTestManual.

Please make sure that SeeTestManual is closed when making these changes.


I hope this quick fix resolves the soapUI JVM maximum heap size issue for you and helps you get back to testing using soapUI!

If you are still unable to resolve this issue, get in touch with me and I will be happy to help you.

Don’t forget to follow QST official Facebook page – a place where testers get together to help each other.

Also, you can subscribe to my free newsletter to make sure you do not miss any future updates from QuickSoftwareTesting!

Happy Testing!

Liked this post?
Sign up now and I will send you more awesome posts like this.
I agree to have my personal information transfered to AWeber ( more information )

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

147 Comments

  1. Made the amendments to .vmoptions (v5.3.0) file which we opened in Notepad++ but it’s giving a security issue stating that file cannot be saved as we don’t have permissions as it’s a system file. That was logged in as normal user, tried again as domain admin and as the pc admin, all failed. Tied again by changing file permissions still not saving.

  2. Unfortunately None of these solutions worked for me on my Windows 10 Enterprise OS. I just reinstalled this soapUI tool and tried with soapui.bat file in the same specified \bin directory and it worked without any hassles. Changed my desktop shortuct to this .bat path. 🙂

  3. Amandeep , please help me i have reduced the size to Xmx256m but that hasnt helped me. is there anyhing else i can try. Need help to solve this issue.

  4. It was really helpful , solution given was easy to replicate and it helped me run SOAP ui when i needed it badly it seems small issue now but i was stuck with it for long time.Thanks for the timely help Amandeep.

  5. I run the SoapUI after reduced the value but i have a similar problem with another software which i would like to fix. For other software, which process i have to follow.
    Thanks.

    1. Thanks – you can try this if you have a 64-bit windows machine.

      Right click on the Review Manager shortcut on the desktop, and choose Properties. Look for the path in the target box which will look like “C:\Program Files\Review Manager 5\Review Manager 5.exe”. Add the following after the last double-quote ‘ -J-Xmx2048M’

      P.S. There is a space to be added after the last-double quote so make sure you do add it.

      So basically, the target box should look like this – “C:\Program Files\Review Manager 5\Review Manager 5.exe” -J-Xmx2048M

      If you are using a 32-bit OS, simply use 1500M instead of 2048M.

      All the best!

  6. Hi Aman
    Greetigns!!
    I got problem with software that is Cochran’s review manager 5.3 software. I got the error: “The JVM could not be started. The maximum heap size (-Xmx) might be too large or an antivirus or firewall tool could block the execution.”
    I reported them this problem and the Cochran support group provided me your link. I installed your program and before running your program i got same error with your program as well and i followed your instruction and changed -Xmx to 512m. After this i could run your program. How can I solve that error with review manager 5.3 software in my computer.

    Your suggestion and help would be appreciated
    Thanks

  7. Thank you so much Amandeep Singh.. You just saved many people’s panic timer..It got fixed with a click away.. Infact none of my colleagues knew this.. Great, perfect.. what not 🙂

  8. Hi Amandeep Singh Ji, I am new to the SOAPUI tool. I was facing the same problem, after installing the soap ui tool.I Googled it and found your site.I tried the steps that you have given.It solved my problem.Thank You. Please keep up the Good Work..!!!
    ~Chaitanya

  9. Thanks a lot Amandeep…yr solution fixed my problem…..i had a problem with saving the file then i open it with run as admin and all well…Thanks again!!

  10. thanks a lot Amandeep, this solved my problem. I was facing this max heap error for the latest version of Ready API.Thanks again!

  11. Iam getting permgen space issue.
    Below are the VM options i have set:
    -Xms128m
    -Xmx12000m
    -XX:MaxPermSize=1028m

    My system is 16 GB, 64 bit operating system.

    Could you help on this.

  12. Interesting… I had used soapUI one year before this error(max heap size) , and it was worked wth xmx=1000m. Do you investigate the reason of the problem?

  13. Hi! When I have the .vmoptions open in Notepad++, it tells me I cannot save the changes (from xmx1000m to xmx512m). I am prompted with the error “Please check if this file is open in another program.” I have force closed SOAPUI and ensured nothing SmartBear related is running from the task manager. How do I push this change through? Thanks!

  14. Thanks, it worked for me.
    One tip, you may have to open your text editor in Admin mode (right click, run as administrator) in order to save your changes.

  15. I was having this same error launching thinkorswim, a stock market platform. Their help page did not work, but your solution did.

    I really appreciate your clear and well written explanation and solution.

  16. Hi Aman,
    I am facing the exact same error in SeeTestManual. I think the same solution will work but the problem is I cannot find the similar file like “soapUI-x.x.x.vmoptions” inside the bin folder of SeeTestManual. Can you please help me on this? Is there any other file where I can mention (-Xmx) value?
    Thanks in Advance.

    1. Hi Afrin – sorry for catching up late on your comment.

      I am not sure if this is relevant for you at this moment but trying to answer it here so that anybody else facing this issue could make use of this.

      Below is a simple method you could use to fix this issue with SeeTestManual from Experitest.

      1. Create new .txt file and add the following text in it.

      “-Xmx(size)” [For example: “-Xmx1024m” (Sets the memory value to 1024mb)]

      2. Save the file with the name as studio.vmoptions. When trying to save it, you will be asked if you are sure: Approve the file extension name.
      3. Place the file into the folder where you installed SeeTestManual (The same directory where studio.exe is located)
      4. Relaunch.

      When making these changes, make sure SeeTestManual is closed.

      I hope this helps!

  17. Hi Aman,
    My soap UI is not getting Launched It takes huge time to get launched.
    could you please help me out with this.

    Thanks,
    Pankaj

    1. Hi Pankaj,

      You can change the -Xmx value in these 2 files to a higher value: “bin\soapui.bat”, “bin\soapui.sh” in addition to “bin\soapUI-x.x.x.vmoptions” which I have written about in the above tutorial.

      Thanks
      Aman

  18. Hi,

    I am using SOAP UI PRO 1.0 version. I am trying to send a XML request which will retrieve the file size of >1GB. But when I see the response bytes recieved , its ~86 mb only. I have increased the settings inFile -> Preference of HTTP Settings-> Maximum Response bytes = 320000000. Still I am unable to retrieve the entire file.

    Also In the VMoptions file, I have updated the value to 3000 so that I am not Java Heap Space Error occured.

    The maximum file that I have to retrieve is >3GB .

    So kindly help me.

  19. Thank you so much Amandeep. I was initially not able to save the file in the location. I tried the solution suggested by Steve and it worked. You both rock!!!!

  20. hi Aman,

    This solution didn’t work for me unfortunately. When I configure the value in vmoptions file & restart Soapui, only the soapui Flash screen gets displayed for long time. Soapui neither starts nor does it give any error.
    I m not sure how to resolve this problem.

  21. Thank you so much! This intermittent issue was driving me crazy! LOL
    Before I was having to reboot my pc, start SOAP UI first, then everything else after that. This box has plenty of memory, There must be a root cause for the jvm not getting enough to begin with.

  22. Hi Amandeep,

    The notepad++ is not letting me save the XMX value change. I am getting “saved failed” error while saving the vmoptions file.

    Looking for a suggestion from your side…

    Thanks
    Gaurav

    1. Hi Gaurav,

      Do you have Admin access to the system where you are trying to save these changes?

      Also, try closing down soapUI and make the changes…

      Thanks,
      Aman

  23. Thanks for the help. This was helpful except that when I tried to do this I kept getting the message “Access denied” when I tried to save the file. I had to save the file on my desktop, then change the name of the original file in the bin directory. I cut the file from my desktop into the bin directory and then deleted the old renamed file in the bin directory.

  24. Hi Amandeep,

    You are a champ !!!!

    Reducing Xmx to 512 has resolved my issue and Soap launched successfully.

    Thanks heaps Amandeep. You rock…

  25. Thanks dude, you helped me to find the solution I needed in less than five minutes.

    Good work!

  26. Hi Amandeep,

    Need your help. I’m learning SoapUI testing after a very long gap.

    I installed this tool on my personal laptop (8 GB ram) and I’m the admin user. After the tool installation, I’m unable to open it as it gives me the java heap size error. I tried to update the file “SoapUI-4.6.4.vmoptions” located at “C:\Program Files (x86)\SmartBear\SoapUI-4.6.4\bin” but, it’s not allowing me to save it stating that access is denied.

    Even though I’m the admin user, not sure why I get this error. Pls help.

    Regards,
    Mahesh

  27. After posting the comment, I tried with one more value i.e. 128m and BINGO!

    It works, thanks for the magic touch!

  28. Hi,

    I am using SoapUI 4.6.3 on Mac. Even after changing values (like you mention) in vmoptions.txt from 1000m to 512m and 256m.

    SoapUI 4.6.3 still hangs. Anything more I can try?

    Thanks in advance.

  29. Greetings,
    I wanted to thank you. I was a bit suprised that this fixed my issue! I am running on 16GB of RAM and did not expect this to be an issue at all, but sure enough, you were right.
    Many many thanks.
    Weaver

  30. This article was exactly what I needed to start soapin’ again. I was in a “heap” of trouble and you helped me out. You rock Amandeep!

  31. Thanks for the post, I am having the same issue with LOADUI, i tried the steps above but could not locate the x.x.x.vmoptions as the bin only exist in the jre, any help how to navigate this, Thanks