Forum Discussion

NewAutoTester's avatar
NewAutoTester
Contributor
6 years ago

java.lang.OutOfMemoryError: Java heap space error?

Hi,

I still get the java.lang.OutOfMemoryError: Java heap space even after updating JVM Options. 

export _JAVA_OPTIONS="-Xms4096m -Xmx4096m -XX:NewSize=256m -XX:MaxNewSize=356m -XXSmiley TongueermSize=256m -XX:MaxPermSize=356m"

 

ERROR:

Scenario Outline: Check for xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Given Prepare a transaction request for "xxxxxxxxxxxxxxxx" with setup user role as "xxxxxxxxx" transaction # StepDefinition.prepare_Transaction_Request(String,String)
java.lang.OutOfMemoryError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:598)
at java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:677)
at java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:735)
at java.util.stream.ForEachOps$ForEachOp.evaluateParallel(ForEachOps.java:158)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateParallel(ForEachOps.java:174)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233)
at java.util.stream.ReferencePipeline.forEachOrdered(ReferencePipeline.java:423)
at java.util.stream.ReferencePipeline$Head.forEachOrdered(ReferencePipeline.java:593)
at com.eviware.soapui.impl.support.loadsave.CompositeProjects.c(CompositeProjects.java:498)
at com.eviware.soapui.impl.support.loadsave.CompositeProjects.loadCompositeProjectFile(CompositeProjects.java:199)
at com.eviware.soapui.impl.support.wsdl.UrlWsdlLoaderPro.a(UrlWsdlLoaderPro.java:35)
at com.eviware.soapui.impl.support.wsdl.UrlWsdlLoaderPro.handleFile(UrlWsdlLoaderPro.java:27)
at com.eviware.soapui.impl.wsdl.support.wsdl.UrlClientLoader.load(UrlClientLoader.java:149)
at com.eviware.soapui.impl.wsdl.support.wsdl.UrlClientLoader.load(UrlClientLoader.java:127)
at com.eviware.soapui.impl.wsdl.support.wsdl.UrlClientLoader.load(UrlClientLoader.java:118)
at com.eviware.soapui.impl.wsdl.WsdlProjectPro.b(WsdlProjectPro.java:629)
at com.eviware.soapui.impl.wsdl.WsdlProjectPro.loadProject(WsdlProjectPro.java:421)
at com.eviware.soapui.impl.wsdl.WsdlProject.<init>(WsdlProject.java:314)
at com.eviware.soapui.impl.wsdl.WsdlProject.<init>(WsdlProject.java:293)
at com.eviware.soapui.impl.wsdl.WsdlProject.<init>(WsdlProject.java:288)
at com.eviware.soapui.impl.wsdl.WsdlProjectPro.<init>(WsdlProjectPro.java:208)
at com.stepDefinition.prepare_Transaction_Request(StepDefinition.java:76)
at ?.Given Prepare a transaction request for "xxxxxxxxxxxxxxxx" with setup user role as "xxxxxxxxx" transaction(xxxxxxxxx.feature:20)
Caused by: java.lang.OutOfMemoryError: Java heap space

 

Could you please help.

    • NewAutoTester's avatar
      NewAutoTester
      Contributor

      We run the project in 2 machines below are the RAM available in them.

       

      RAM:

      Linux Machine - 4 GB

      Windows Machine - 16 GB

      • jhanzeb1's avatar
        jhanzeb1
        Frequent Contributor

        I've seen this error before, I used to get this error while dealing with data-driven tests that required a lot of test data from an oracle DB in a short space of time. 

         

        What's the size of your XML file please? if it's over 20mb, I'd recommend splitting it into two and run the tests seperately. This was the case in free soapUI version. What SoapUI version are you using?

         

         

  • groovyguy's avatar
    groovyguy
    Community Hero

    NewAutoTester: Is this error coming from the Linux or Windows machine?

     

    On your Linux machine, setting the memory values to 4096 means you are allowing ReadyAPI to use ALL of your available RAM. It will not be able to do that, since the OS and other applications will need to use some RAM as well.

     

    On the Windows machine, I'd say you could safely set that value to 12288 instead of 4096 to see if it fares any better. That would be 75% of your 16GB of RAM which might work better for you. My testing machine has 32GB of RAM and I set my memory to 24576.