It is possible that while using AfterMath to run an experiment, the experiment aborts, unexpectedly, and you receive an error message that states, "Out of Memory." This error indicates that the memory Windows(R) allocates to AfterMath has been consumed and the experiment terminated prematurely because the software application could no longer output and acquire signals.
Most commonly, this is related to running a single experiment or series of experiments that have a long durations (days, hours, weeks) and likely amass large data sets and data streams. AfterMath is allocated a finite amount of system memory to operate, and little can be done to change this (it is controlled by Windows); however, there are several considerations to implement to reduce the risk of running out of memory.
In summary (details below), the following can be done to minimize the risk of running out of memory:
- Verify computer meets minimum requirements
- Close unused archives so they are not present in AfterMath during live experiments
- Be mindful of archive size. Keep archives < 10 MB each
- Modify/change sampling threshold
- Discard Applied Signal
- Do not view long-term experiments live entertainment plot
- Conduct Long-Term experiments with special multi-archive/auto save and close features
The expanded description of the "Out of Memory" error can be summarized as, "AfterMath was using all the memory it can to perform the action you requested; however, in the course of performing the task(s), all memory was consumed and the experiment terminated prematurely." To resolve this, users must take actions as detailed below. This error is not a bug, it is a real error that the software itself cannot resolve.
2.1Verify Computer Requirements
While AfterMath itself is not a very large or resource intensive application, streaming large amounts of data for a long enough amount of time has consequences. As a result, we have tailored or system requirements to cover the general case. Please consult these requirements
. If you computer does not meet the minimum system requirements, you are strongly encouraged to use AfterMath and its connected potentiostat on a more capable computer.
2.2Close Unused Archives
Archives open in AfterMath consume memory, even if you aren't using them. Merely having an archive open, especially if the archive is large (e.g, > 1 MB) requires the consumption of memory, in the chance you want to expand elements in the archive such as viewing plots, copy/pasting data, etc.
Figure 1. Close Unused Archives in AfterMath to Minimize Memory Consumption.
You can always use AfterMath to view, analyze, and process data from multiple archives, even large archives; however, doing so while you are also running an experiment, namely a long-term experiment, you run the risk of running out of memory. We suggest minimizing the number of open archives in AfterMath when running a long-term experiment.
2.3Minimize Archive File Size
One of the most useful and distinct features of AfterMath is the archive. Most instrument software is merely an interface between the user and the hardware and minimal, if any, effort is given by the software authors to allows users to engage with the data acquired. AfterMath changes this tradition by allowing users to aggregate many experiments under a single file. This helps with organization and storage of data. In other words, AfterMath can be used as a one-off "click run, get data, export data" software, common to the industry, but it goes far beyond by the ability to create and rename elements, add folders, and truly organize a day's work into a single file.
Making AfterMath do this is not without consequence. It is entirely possible to create an archive and pack it so full of experiments. There's no limit on the number of experiments you can have within a single archive; however, the more experiments (nodes, notes, analyses, etc.) you add, the larger the archive becomes. If you were to run a 2-week cyclic voltammetry experiment, you may easily generate > 30 MB of data. If you repeat the experiment from the same archive, now your archive will swell in size. The larger the archive, the more memory it takes to have it open. This is why we recommend being mindful of the size of your archives. You can easily view the archive size in Windows Explorer. We recommend keeping single archives < 10 MB in size whenever possible. Sometimes you cannot, and that's acceptable, but we recommend you don't have many of these large archives open when trying to run a long-term experiment.
Also, be mindful of the archive size. Instead of adding many long-term (e.g. large data) experiments to a single archive, create a new archive for each long-term experiment instead. This recommendation is also consistent with our advice on performing long-term experiments
2.4Modify Sampling Threshold
In the context of the "out of memory" error, a common cause might be the size of the data streams for a long-term experiment. A single experiment, running for hours/days/weeks can generate a lot of data. The final data stream is not written out to the archive until the completion of the experiments. While there are data-recovery features baked into AfterMath, it is best not to rely on them. One of the ways one can reduce the size of the archive is to adjust the sampling threshold of an experiment.
With sweep experiments, such as Cyclic Voltammetry, on the "Advanced" tab you will see a group for Sampling Options.
Figure 2. Sampling Group on the Advanced Tab of Sweep Techniques, which includes Threshold Option.
Threshold defines when, along each micro-potential step of the sweep, to sample (current and potential). The inputs can be:
- Default (5 mV)
- None (no defined interval, samples as often as possible)
- User input (enter a potential value into the dropdown)
For long-term experiments, users commonly do not need short interval sampling. In most cases, changing the Threshold to a larger interval is all that is necessary (e.g., 10 mV or more). Making the interval larger reduces the number of samples that will be collected, which in the course of a long-term experiment, reduces the number of data points and ultimately the size of the study in the archive.
2.5Discard Applied Signal
Unlike most other potentiostat acquisition software, AfterMath generates post-experiment plots that were acquired during the experiment, but may not be the final presentation plot. For example, in cyclic voltammetry, the user defines a potential sweep. As the sweep is applied to the electrochemical cell, current and potential are sampled as specified intervals (see: Threshold). AfterMath records and saves all related data series, including: applied potential vs. time, measured potential vs. time, current vs. time, and current vs. potential. Most users are interested in the presentation plot, which for CV is the cyclic voltammogram or the current vs. potential plot.
Within a given experiment, the "supplementary" data streams are saved and often plotted. These are placed in the "Other Plots folder"
Figure 3. Other Plots Folder Likely Contains the Applied Signal Data.
The "Applied" signal is simply a data stream generated by AfterMath. For this example, the "Applied Potential vs. Time" is a data stream (trace on a plot) of the calculated potential vs. time that AfterMath determined based on user input during sweep definition. Overlaid is the "Potential vs. Time" which is the measured potential vs. time, i.e., the potential and time that was measured (actually happened) during the experiment. The result is a single plot of Potential, with two data traces. In many cases, this plot and these traces are extraneous and not necessary or interesting. We program AfterMath to keep the applied signal, by default, because there is diagnostic value in comparing what AfterMath calculated the sweep to be (agnostic of the cell, electrodes, and chemistry at the end of the cell cable) and what was measured (inclusive of the cell, electrodes, and chemistry at the end of the cell cable). For example, if one has a reference electrode issue (e.g., blocked frit, for example), one would see a significant deviation between applied and measured potential signals.
This article is about finding ways to mitigate running out of memory. One of the ways to help is in reducing the size of the archive. If you determine that the applied signal is not of interest or value to your experiment, you can optionally choose to discard this signal, thereby reducing the size of the study resulting from an experiment, which reduces the size of the archive. This is done by selecting "My Profile" in the lower left of AfterMath, then ticking the "Discard Applied Signal Data" option on the Experiments tab.
Figure 4. Discard Applied Signal Option in My Profile.
2.6Navigate Away from Live Entertainment Plot
By default, after you start an experiment, AfterMath navigates to the live entertainment view. This is what users commonly expect to see, which is a plot showing the acquired data, updated as new data are acquired. AfterMath handles updating this plot seamlessly in most cases, but in the case of long-term experiments (with hundreds of thousands of data points over the span of many hours) AfterMath will require increasingly more memory to handle updating the plot.
To mitigate memory consumption due to live plot updating, navigate away from the live entertainment plot after you submit an experiment. This is strongly suggested for long-term experiments. Select anywhere else in the archive (e.g., the Experiment Parameters node) instead, such that the application isn't using precious memory resources to update a plot that has been running for hours...days...weeks.
2.7Use Long-Term Experiment Strategies
The "Out of Memory" issue is a rare occurrence, but when it arises, it is often related to long-term experiments. Long-term experiments can generate a lot of data, all of which is managed by AfterMath. The worst outcome is data loss for an already long time running experiment.
Special considerations for conducting long term experiments is described here on our knowledgebase
, and we recommend you review this article to identify strategies for safely conducting long-term experiments.
3Consider 64-bit Application
AfterMath is currently available as a 32-bit application. Our software team has successfully updated AfterMath as a 64-bit application. At the time of this article, the 64-bit version has not yet been released publicly; however, it will likely be widely available by Summer 2023.
A 64-bit AfterMath can only be run on a 64-bit version of Windows (7, 8, 10, and soon, 11).
64-bit AfterMath can handle more data at once and can access more than 4GB, which is the limitation of 32-bit applications. If you have tried all other options mentioned above and still encounter "Out of Memory" errors, contact us
and we can help you get a 64-bit application installed (NOTE: the 64-bit version has a significant update to the user interface of AfterMath).