General System Limits
This appendix lists some of the limits that are applicable across all server-side languages. It discusses the following topics:
For limits on identifier names, see “Rules and Guidelines for Identifiers.”
For additional system-wide limits, see the Caché Parameter File Reference.
Long String Limit
There is a limit to the length of a value of a variable. If you have long strings enabled in your installation (as they are by default in new installations as of release 2012.2), the limit is 3,641,144 characters. If long strings are not enabled, the limit is 32,767 characters.
To enable or disable long strings, you can use the Management Portal, as described in “Enabling Long String Operations,” earlier in this book. (Or, in the Caché parameter file, specify the value of the EnableLongStrings parameter, as described in the EnableLongStrings section of the Caché Parameter File Reference.)
Caché also supports the use of long strings on an optional, per-instance basis. To enable long strings for the current instance, use the EnableLongStringsOpens in a new tab property of the Config.MiscellaneousOpens in a new tab class.
When a process actually uses a long string, the memory for the string comes from the operating system’s malloc() buffer, not from the partition memory space for the process. Thus the memory allocated for actual long string values is not subject to the limit set by the Maximum per Process Memory setting on the System Memory and Startup Settings page and does not affect the $STORAGE value for the process.
It is important to realize that “strings” are not just the result of reading from input/output devices. They can show up in other contexts such as the data in the rows of a resultset returned by an SQL query, by construction of $LISTs with a large number of items, as the output of an XSLT transformation, and many other ways.
If long strings are not enabled, Caché cannot guarantee that an application can take advantage of published limits. These limits all assume that long strings are enabled, unless otherwise noted.
Class Limits
The following limits apply only to classes:
Limit: 50. A given class can be subclassed to a depth of 50 but not further.
Limit: 400 per class.
Limit: 400 per class.
Limit: 2000 per class.
Limit: 1000 per class.
Limit: 200 per class.
Limit: 1000 per class.
Limit: 200 per class.
Limit: 200 per class.
Limit: 10 per class.
Limit: 127 per class.
Limit: 200 per class.
Limit: 1000 per class.
Class and Routine Limits
The following limits apply to both classes and routines:
Limit: 32768 unique references per routine or class.
The following is counted as two class method references because the class name is different even though the method name is the same.
Do ##class(c1).abc(), ##class(c2).abc()
Limit: 32768 unique references per routine or class.
For example, the following is counted as two class name references:
Do ##class(c1).abc(), ##class(c2).abc()
Similarly, the following is counted as two class references because the normalization of %FileOpens in a new tab to %Library.FileOpens in a new tab is done at runtime, not at compile time.
Do ##class(%File).Open(x)
Do ##class(%Library.File).Open(y)
Limit: 32768 per routine or class.
If X and Y are OREFs, the following counts as one instance method reference:
Do X.abc(), Y.abc()
References to multidimensional properties are counted as instance methods because the compiler cannot distinguish between them. For example, consider the following statement:
Set var = OREF.xyz(3)
Because the compiler cannot tell whether this statement refers to the method xyz() or to the multi-dimensional property xyz, it counts this as an instance method reference.
Limit: 65535 lines per routine, including comment lines. The limit applies to the size of the INT representation.
Limit: 65535 ASCII literals per routine or class.
An ASCII literal is a quoted string of three or more characters where no character is larger than $CHAR(255).
Note that ASCII literals and Unicode literals are handled separately and have separate limits.
Limit: 65535 Unicode literals per routine or class.
A Unicode literal is a quoted string with at least one character larger than $CHAR(255).
Note that ASCII literals and Unicode literals are handled separately and have separate limits.
Limit: 255 parameters per subroutine, method, or stored procedure.
Limit: 32767 per routine.
Limit: 32768 per routine or class.
This limit refers to reading the value of a property as in the following example:
Set X = OREF.prop
Limit: 32768 per routine or class.
This limit refers to setting the value of a property as in the following example:
Set OREF.prop = value
Limit: 65535 per routine or class.
This limit applies to the number of unique references (^routine) in a routine or class.
Limit: 65535 per routine or class.
A target is label^routine (a combination of label and routine).
Any target reference also counts as a routine reference. For example, the following is counted as two routine references and three target references:
Do Label1^Rtn, Label2^Rtn, Label1^Rtn2
Limit: 65535 per routine.
Limit (ObjectScript): 32763 per procedure.
Limit (Caché Basic or MVBasic): 32759 per routine.
Limit (ObjectScript): 65503 per routine or class.
Limit (Caché Basic or MVBasic): 65280 per routine or class.
For limits on the lengths of variable names and other identifiers, see “Rules and Guidelines for Identifiers,” earlier in this book.
Other Programming Limits
The following table lists other limits that are relevant when writing code.
Length limit of error message: Just under 32k characters.
Maximum number of %StatusOpens in a new tab values that can be combined into a single %StatusOpens in a new tab value: 150.
Limit: 32767 levels.
This is the maximum depth of nesting of any language element that uses curly braces, like IF { FOR { WHILE {...}}}.
Limit: 65535 characters per line, if long strings are enabled. Note that in Studio, you cannot edit lines longer than 32767 characters.
See “Maximum Length of a Global Reference” in Using Caché Globals.
Limit: 511 encoded characters (which may be fewer than 511 typed characters). The term global reference refers to the name of the global plus all of its subscripts. For a discussion, see “Maximum Length of a Global Reference” in Using Caché Globals.
Limits (for decimal or native format): Approximately 1.0E-128 to 9.22E145. See “Numeric Computing in InterSystems Applications,” later in this book.
Limits (for double format): See “Numeric Computing in InterSystems Applications,” later in this book.