Optimizing Memory Usage

Applies to ReadyAPI 3.57, last modified on December 20, 2024

ReadyAPI may consume a lot of memory. It depends on its settings and on the ways you use it. If you run large functional or load tests, you may face lack of memory. This topic explains how to avoid memory issues.

Note: Starting from version 2.2, ReadyAPI includes a built-in system performance monitor. To learn more about it, see Monitor System Performance.

Test case memory usage

If you are short of memory, most likely, you run large test cases that send thousands of requests. By default, ReadyAPI automatically saves both requests and responses, so you can double-click them to view the corresponding entry in the test case log. Of course, this will fill up memory over time, no matter how much memory you have allocated. Fortunately, there are ways to discard old results if they are not needed.

Modify test case options

Test case options can be accessed from the test case toolbar:

The test case toolbar

Click the image to enlarge it.

There are two settings in the Test Case Options dialog that affect memory usage:

The Test Case Options dialog

Click the image to enlarge it.

  • Discard Successful Results – Select this option to discard the content of any successful test step result. In this case, you will not be able to view it by double-clicking the corresponding results in the test case log.

  • Max Results – Specifies how many test step results ReadyAPI keeps in memory, regardless of their state. If you specify 0, ReadyAPI will keep all the test step results in memory until the test run is over.

    Note: If you specify 0 as the Max Results value, your load tests will discard the results when virtual user simulation is over. To keep test results in memory, specify a very high value.

ReadyAPI keeps a discarded test step result in memory if it is visible in the log. See below to learn how to modify the log options so that the test case log does not keep the results.

Modify test case log options

ReadyAPI keeps test results in memory if they are shown in the test log. You can customize the results that are visible in the log by using test case log options.

Note: If you run tests from the command line, there is no log, so there is no need to modify the test case log options.

Click  > Results Log Options :

The test case log toolbar

Click the image to enlarge it.

This opens the Log Options dialog.

The Log Options Dialog

These options control what is visible in the log. Removing results from the log does not necessarily mean they are removed from memory. See above to learn how to prevent ReadyAPI from keeping test results in memory.

Adjust memory settings

If your test consumes a lot of memory, most probably, you should optimize it. However, if your test contains large requests, attachments, and so on, you will have to increase the maximum size of the memory ReadyAPI can allocate.

To specify that value, you should modify the -Xmx parameter that ReadyAPI passes to the Java virtual machine. Choose a value depending on the settings of your operating system, other running applications and so on. We recommend that you allocate about half of the available memory. For example, if you have 16 GB of RAM on your machine, specify 8192 MB.

Note: If you have a 32-bit operating system, it is impossible to allocate more than 1,5 GB.

Depending on the way you run ReadyAPI, modify the setting by editing the .vmoptions file or the .bat\.sh file. To learn how to do this, see Modifying Advanced Settings.

Disable test history

If your tests are already set up and you no longer need the test history, you can disable it to free some memory.

Open the Test History Preferences dialog and select the Test History disabled option. After you do this, you will have to restart ReadyAPI.

See Also

Modifying JVM Settings
Best Practices

Highlight search results