Some suggestions for increasing the available memory:
• Turn the instrument off and on. This deletes scripts that have not been saved and reloads only
scripts that have been stored in nonvolatile memory.
• Remove unneeded scripts from nonvolatile memory. Scripts are loaded from nonvolatile memory
into the run-time environment when the instrument is turned on. See Delete user scripts from the
instrument (on page 10-49).
• Reduce the number of TSP-Link
®
nodes.
• Delete unneeded channel patterns (this affects only pattern memory, not instrument memory).
See Channel patterns (on page 5-19).
• Delete unneeded DMM configurations (this affects only configuration memory, not instrument
memory. See Save DMM configurations (on page 4-7).
• Delete unneeded global variables from the run-time environment by setting them to nil.
• Set the source attribute of all scripts to nil.
• Adjust the collectgarbage() settings in Lua. See Lua memory management (on page 10-30)
for information.
• Review scripts to optimize their memory usage. In particular, you can see memory gains by
changing string concatenation lines into a Lua table of string entries. You can then use the
table.concat() function to create the final string concatenation.
The example below shows an example that optimizes a channel pattern that consists of five
channels.
ch1 = "" .. 5 * 1000 + 15 .. ","
ch2 = "" .. 5 * 1000 + 25 .. ","
ch3 = "" .. 5 * 1000 + 35 .. ","
ch4 = "" .. 5 * 1000 + 915 .. ","
ch5 = "" .. 5 * 1000 + 925
testPattern = ch1 .. ch2 .. ch3 .. ch4 .. ch5
print(testPattern)
If the instrument encounters memory allocation errors when memory used is above 95
percent, the state of the instrument cannot be guaranteed. After attempting to save any
important data, it is recommended that you turn off power to the instrument and turn it back
on to return the instrument to a known state. Cycling power resets the run-time environment.
Unsaved scripts and channel patterns will be lost.