Forum Discussion

Vijaysharma's avatar
Vijaysharma
New Contributor
7 years ago

I am getting java memory error while executing test case

While working with SOAP UI open source version I am getting one error related to memory again and again.Please help me.

  • PramodYadav's avatar
    PramodYadav
    7 years ago

    No worries. What the link essentially says is : Go to bin -> soapui.bat file. , edit in say notepad++, find the below line and change the value of Xmx****m to a higher value (see below):

     

    set JAVA_OPTS=%JAVA_OPTS% -Xms128m -Xmx256m -Dsoapui.properties=soapui.properties

    ->to higher values for the max allocated size, for example:

    set JAVA_OPTS=%JAVA_OPTS% -Xms128m -Xmx2048m -Dsoapui.properties=soapui.properties

     

    NOTE: I have a system with 8GB ram, so the max I can go is till 4GB (4096=1024*4). You can change the settings based on your machine configuration.

     

    Hope this helps!

  • Two possible solutions:

    1. Read here: https://community.smartbear.com/t5/SoapUI-Pro/Soap-UI-Out-of-memory-error/td-p/25862 

    2. I had a similar issue. I was building a string in a for loop for a very big file and was doing a log.info in each iteration to check the content of the string. Now apparently, all these log.infos were consuming a lot of internal memory and I was getting a memory error. Once I commented out the log.info step inside for loop (and put it outside to print final string), the out of memory error was taken care. I also make changes as per step1, later, just to be sure.  

    Hope this helps!

    Cheers, Pramod

     

    P.S: If this does help solve your problem, accept the solution and give a kudos ;)

     

    • Vijaysharma's avatar
      Vijaysharma
      New Contributor

      Hey Pramod,

       

      The link you shared is resulting in an error page.The 2nd solution is not related to my query.

      Thanks

      • PramodYadav's avatar
        PramodYadav
        Contributor

        No worries. What the link essentially says is : Go to bin -> soapui.bat file. , edit in say notepad++, find the below line and change the value of Xmx****m to a higher value (see below):

         

        set JAVA_OPTS=%JAVA_OPTS% -Xms128m -Xmx256m -Dsoapui.properties=soapui.properties

        ->to higher values for the max allocated size, for example:

        set JAVA_OPTS=%JAVA_OPTS% -Xms128m -Xmx2048m -Dsoapui.properties=soapui.properties

         

        NOTE: I have a system with 8GB ram, so the max I can go is till 4GB (4096=1024*4). You can change the settings based on your machine configuration.

         

        Hope this helps!