Skip to main content

EnableLongStrings

Enable/disable a large stack space for long strings.

Synopsis

[Miscellaneous]    EnableLongStrings=n

Description

Caché allocates a fixed amount of space to hold the results of string operations, the string stack. If a string expression exceeds the amount of space allocated, a <STRINGSTACK> error results.

The EnableLongStrings setting is available, if needed, to significantly increase the size of the string stack. The value may be 1 or 0:

  • Default. When 1 (true), Caché does not get a max string error and works with long strings. The memory allocated for actual long string values is not subject to the limit set by the bbsiz parameter and does not affect the $STORAGE value for the process. For any platform where memory is allocated up front, this is significant at ~7MB and ~14MB (8–bit unicode).

  • When 0 (false), this option is disabled.

When you turn on long strings, every process begins with a larger fixed-size string stack. The string stack is for temporary string handling during a command. When you actually store a long string in a variable, the system allocates new memory for it. (There is optimization for two variables storing the same long string to point to the same malloc()'d memory (until one of them changes)). When you store a normal string (less than 32k) it comes out of the process buddy block memory (bbsiz, aka max mem per process), even when long strings are turned on.

When a process uses a long string, the memory for the string comes from malloc() instead of from the partition memory. Thus the $STORAGE value is not affected. When the string is killed, Cache releases (with free()) the memory that it got from malloc() for the long string. (Note that this is different for HPUX. HPUX does not release the memory; the process on HPUX retains the memory after free() and that memory becomes available for a subsequent malloc(). If that memory were never used again, it is eventually paged out by the HPUX memory manager (assuming there was some shortage of physical memory).

The value of this setting affects only Caché jobs started after it is changed. Existing jobs are not affected and maintain their current string stack size.

Examples

EnableLongStrings=0

Range of Values

0 or 1. The default is 1.

Management Portal

On the page System Administration > Configuration > System Configuration > Memory and Startup, to enable support for long strings, select Enable Long Strings.

FeedbackOpens in a new tab