Forum Discussion

ebertb's avatar
ebertb
New Contributor
11 years ago

InferredSchemaManager HashMaps Grow Continously

When running SoapUI in a system over a long period of time (maybe a few days, while running various test cases periodically), the HashMaps in InferredSchemaManager grow out of control, and it doesn't seem that any of the "RestService" keys ever get removed. After a few days, the InferredSchemaManager is taking up about 15G of memory.

In our use case, we're running test cases in different threads, so we've been able to solve this problem by essentially breaking the caching mechanism and putting the HashMaps in ThreadLocal. For now, this allows SoapUI to run continuously without memory issues, but it's probably not how the code was intended to work.

4 Replies

  • Hi,

    Can you provide more details such as what version of SoapUI you are using, the test steps you are using, maybe a java heap dump showing this problem? Are you getting or posting large data in your REST calls? Any additional information would be much appreciated. Thanks.
  • ebertb's avatar
    ebertb
    New Contributor
    The SoapUI version being used is 4.6.4. We are using it through Java and not the UI. Various tests are run periodically containing REST request steps, property transfer steps, and groovy script steps/assertions. There are some cases where we do retrieve fairly large REST responses (a few Megabytes in size).

    I noticed that InferredSchemaManager.release() doesn't end up getting called in our use case, but it can be explicitly called on an instance of WsdlProject via its release() method. However, doing this messes up any other test cases that may be running concurrently in other threads.

    Here is a screenshot showing memory usage up to 15G. You can see that over time, InferredSchemaManager ends up having over 17 million entries that never get removed.


    Here is a screenshot showing memory usage after putting the HashMaps into ThreadLocal (and running for a few days), which solves it only for our use case where we are running each test case in its own thread.
  • Hi,

    Please try SoapUI 5.0.0 and check if the same problem occurs. It sounds like you are using the SoapUI API and you are not using the GUI or testrunner.bat\.sh? Please confirm.
  • ebertb's avatar
    ebertb
    New Contributor
    We've upgraded to 5.0.0 and the same problem does occur, and changing the code as mentioned in the original post still fixes the problem (for us). We are using the SoapUI API through Java to run the test cases.