To do so, use the SetApplLimit procedure to change the application heap limit before you call the MaxApplZone procedure. To initialize a new heap zone, use the InitZone procedure. The Operating System automatically initializes the application zone by calling the SetApplBase procedure, which subsequently calls the InitApplZone procedure. GetApplLimit Use the GetApplLimit function to get the application heap limit, beyond which the application heap cannot expand. The Memory Manager expands the application heap only up to the byte preceding this limit.
Nothing prevents the stack from growing below the application limit.
If the Operating System detects that the stack has crashed into the heap, it generates a system error. To avoid this, use GetApplLimit and the SetApplLimit procedure to set the application limit low enough so that a growing stack does not encounter the heap. The GetApplLimit function does not indicate the amount of memory available to your application. The global variable ApplLimit contains the current application heap limit. SetApplLimit Use the SetApplLimit procedure to set the application heap limit, beyond which the application heap cannot expand.