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.
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!
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!
I tried with soapui.bat file in the same specified \bin directory and it worked without any hassles.
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.
THX bro , Great answer.
Thank you a lot!
TY!!, it really works… 🙂
wow, Great am suffrng from few days ,u gv a solution.Thank u Dear
That is really great. it’s worked for me.
thnx bro it works!
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. 🙂
Thanks for sharing it here, Sridhar 🙂
Thank you very much. 🙂
Thank you very much.. it worked for me.. 🙂
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.
Thx! really helpful mate!
Excelentt. This solve my problem.Thank you so much
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.
Great to know this solution helped you, Bheemsen 🙂
HI Aman
Thank you very much, I got it, I fixed it at 500 and worked now.
Awesome 🙂
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.
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!
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
Hi Dharma, did you try increasing the -Xmx value further in increments of 128?
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 🙂
That’s amazing, Nikhilesh ?
You should probably recommend this blog to your colleagues! ?
Perfect!! fist time a solution that works at first try! thank you so much for sharing this information!!!!
I am overwhelmed with your comment.. thanks and have an amazing day! 🙂
Worked like a charm, Thank you Amandeep!
Love it when it works for my readers 😀
Thanks.
Easy fix to resolve this issue
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
Thanks a lot Chaitanya – I am really glad I was able to help!
Thanks!!! You is da Aman.
thanks. it helped..
Thank you for posting this, your solution quickly resolved my error.
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!!
Perfect! 😉
Thanks for the post
Great..it did work for me..Thanks a lot..
Thanks for the blog. Explains very well and solved my Issue like for others above.
Thanks again!
thanks a lot Amandeep, this solved my problem. I was facing this max heap error for the latest version of Ready API.Thanks again!
Thanks! It works.
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.
Excelente! amigo……………………….gracias
Thanks. It worked by reducing the heap size.
Thank bruv..
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?
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!
Hi AJ, did you try opening the file as Admin user as per the tip given by Guilherme above?
Hi Aman your solution was clear cut and came in handy, good job n thanks.
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.
Thanks for sharing the quick tip, Guilherme.. I will surely add this to the article. Cheers!
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.
Cheers, Allen 🙂
Thanks Aman ,
It resolved the issue and able to launch the SOAP UI tool.
Regards,
R S Satish
Thanks
Very helpful. Thanks a lot for saving my time.
Thank you very much!
Simple and very well explained solution.
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.
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!
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
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
Hi Amandeep,
I am getting ‘out of memory ‘ error.
Shall i follow above steps for the same ?
Yes Vinay, you can try this.
Awesome solution. Thanks a lot. It solved my problem as well.
Thanks Sheena!
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.
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!!!!
Thanks a lot !!
This help me to solve my problem..!!!! 😀
thanks so much! That worked a treat.
Thanks a lot Amandeep. It worked for me too.
Thanks a ton !! This helped me too …
Thanks a lot! Saved my day….
Started getting this error after removing Semantic and installing BitDefender.
Solution worked well for me! Thank you for all you do.
Really nice! It worked for me! Thanks 🙂
Great solution!! thanks…
It worked.. Thanks.
Thanks Buddy.. It worked,,,
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.
Hi Madhavi, can you please try changing the vmoptions file with soapUI shut down first and then try starting it from scratch?
I hope this helps you…
working superb
WOw… This worked like a charm. Thanks so much for sharing. Thumbs up!!
Cheers, Mofor!
thanks paaji, it solved my problem!
Thanks Aman.. It worked Man..
Thanks for the explanation.. The solution looks simple but your explanation is awesome
Thanks, Nikhil.. I am pleased you liked it 😀
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.
Thanks!!
Thanks, bro!!
Thanks, this fix resolved my issue!
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
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
Gaurav, you can also try what one of my readers, Steve tried here
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.
Thanks for sharing it here, Steve…
Thank you. Your steps helped me to resolve this issue.
Thank you very much for posting. This did the trick!
Thanks!!! It has work for me!!
Cheers, Alma 🙂
Hi Amandeep,
You are a champ !!!!
Reducing Xmx to 512 has resolved my issue and Soap launched successfully.
Thanks heaps Amandeep. You rock…
Thanks for the kind words, Senthil.. I am glad this helped you!
Thanks dude, you helped me to find the solution I needed in less than five minutes.
Good work!
Cheers David 🙂
You are the Maaaaaaannnn. thanks
🙂
Thanks a lot, it helped :)))))))))))))))
Thanks for the useful information. It is solved my issue
Thanks Amandeep. It solved my problem.
thanks, it helped a lot!
How do i do in Ubuntu 13.10, I dont see and vmoptions file for the soapUI 4.6.4. Please help !!!!
Hi Amar – please try in home/user/eviware/soapUI-x.x.x folder
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
Hi Mahesh, thanks for your comment…
Are you able to share the screenshot of this error? You could use tinygrab to do it…
Thanks,
Aman
It saved a day. It Works fine now. Thanks…
Thanks It worked for me
Thanks mate !! it’s work good !!
After posting the comment, I tried with one more value i.e. 128m and BINGO!
It works, thanks for the magic touch!
Great 🙂
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.
solved my problem thanks for sharing
Thanks for this post. It solved my issue in no time.
Thanks – this help me. Thank you for sharing this solution.
Thanks. It is working fine
Amandeep I changed -Xmx128m but still i am getting the same error.
I tried your steps and went down to 64m but still get the same error. Can anything else cause this?
Thanks
@Bala, Mike – what are your -Xms values please?
Thanks a lot Aman. I use a machine with 32GB Ram and still faced this issue, now looks like the issue was different.
Fixed my issue 🙂
nice and clearly written and laid out.
Thanks
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
Glad I could help, Weaver…
Solved my problem. Thanks for sharing your knowledge.
Glad to know, this could help you Romulo…
Thanks, that was very useful!
Karin, I am glad I could help you resolve this issue with soapUI
Doesn’t it affects the soapUI ?
Hi Arik,
I didn’t get your question – can you please elaborate and I will try to help you in the best way I can…!
thks
I faced this problem with Cytoscape. But by your solution helped me to resolve this..
Thanks a lot
Great to know, Kotresh…
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!
I am really glad I could help getting you back on track – thanks J@mes..!
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
Hi John – this link should help you http://viralpatel.net/blogs/jvm-java-increase-heap-size-setting-heap-size-jvm-heap/
Thank you for posting this, it solved the memory problem for me.
Hi Mike – I am glad this resolved your issue 🙂