The ScriptMemLimit field in the cufconfig Globally Distributed Object (GDO) is used to limit the memory that is made available on every AMP during a single call to SCRIPT. The default limit is 32 MB, but this is typically inadequate for external language execution, because the AMP holds in memory all the libraries and data loaded when a language script instance executes on the AMP. Recommended values for the ScriptMemLimit field are in the range of 1 - 3 GB (1073741824 to 3221225472 bytes). Lack of memory might result to an explicit error during SCRIPT execution; more often, however, it may manifest as unrelated errors that can be difficult to interpret. To use the maximum available memory, set ScriptMemLimit to 0 (nonzero value recommended to retain a consumption limit per AMP).
The following example assumes default settings on a system, and shows how to check and change the ScriptMemLimit value to 1 GB.
- Connect as root user to the target system, and use a Bash shell command line.
- Inspect the current cufconfig parameters and their values by the command:
- Locate the ScriptMemLimit field in the output listing. It should appear among the output as follows:
... ScriptMemLimit: 33554432 ...This means the ScriptMemLimit size is 33554432 bytes / 1024 (KB/byte) / 1024 (MB/KB) = 32 MB.
- To change this value to 1 GB, create a text file in the /tmp directory of every node on the server, so that this file contains the line: ScriptMemLimit: 1073741824.
psh "printf ScriptMemLimit: 1073741824' > /tmp/ccChange.txt"Memory size must be specified in bytes.
- Invoke the cufconfig utility to accept the new setting by the following command:
psh /usr/tdbms/bin/cufconfig -i -f /tmp/ccChange.txt
- Inspect the result using the following command: