HP NonStop SQL/MP Programming Manual page 299

For c
Table of Contents

Advertisement

Memory Considerations
If a stack overflow occurs, the executor traps (trap number 3), sends a message to
the EMS collector process ($0), and then abends. You can read the EMS event log
for this message. For a description of the SQL/MP messages sent to the $0
process, see the SQL/MP Messages Manual. If a call to the file system causes a
stack overflow, the SQL executor returns SQL error 8003 and file-system error 22.
You can prevent a stack overflow in a C program by following these guidelines:
Use the large-memory model. Specify the XMEM pragma (the default) to select the
large-memory model and the XVAR pragma (also the default) to direct the
C compiler to allocate static aggregates in extended memory.
Allocate SQL internal data structures (SQLIN, SQLIVARS, and SQLOVARS) in
extended memory (which is the default for the large-memory model). The
SQLMEM pragma (USER or EXT) controls the placement of the SQL structures;
SQLMEM EXT (extended memory) is the default.
Use the Binder SET EXTENDSTACK command to extend the user stack space.
For more information, see the Binder Manual.
When you start the program, increase the number of data pages for the program
using one of these options:
Interactively, specify the MEM option to increase the data pages in the TACL
RUN command. For more information, see the TACL Reference Manual.
Programmatically, set the memory-pages parameter of the NEWPROCESS or
PROCESS_CREATE_ system procedure. For more information, see the
Guardian Procedure Calls Reference Manual.
HP NonStop SQL/MP Programming Manual for C—429847-008
Avoiding Memory Stack Overflows
B-5

Advertisement

Table of Contents
loading

Table of Contents