Kbase P132109: I am getting a stack overflow error, how can I determine what value to set the -s parameter to?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  12/2/2008 |
|
Status: Verified
GOAL:
I am getting a stack overflow error, how can I determine what value to set the -s parameter to?
GOAL:
How can I determine how much stack space is being used?
FACT(s) (Environment):
All Supported Operating Systems
Progress 8.x
Progress 9.x
OpenEdge 10.x
FIX:
The SHOW-STATS ABL command will cause the current stack usage, maximum stack usage and the stack limit (as specified by the -s startup parameter) to be written out to the client.mon file in the same manner as using the -y startup parameter does.
To use the SHOW-STATS command properly you must invoke it once at the beginning of your code execution in order to open the client.mon file for output. The first execution of the SHOW-STATS command will not actually dump information into the client.mon file, it just opens the client.mon file for output.
To see the stack usage you should then insert the SHOW-STATS command at appropriate points in your applications code. Each time you invoke the SHOW-STATS command more information will be written to the client.mon file showing the current state of the stack (amongst other things).
The following code sample shows how to properly use the SHOW-STATS command:
DEFINE VARIABLE iLoop AS INTEGER NO-UNDO INITIAL 0.
DEFINE VARIABLE cData AS CHARACTER NO-UNDO.
SHOW-STATS. /* just opens the client.mon file for output */
RUN TestProc IN THIS-PROCEDURE (cData).
PROCEDURE TestProc:
DEFINE INPUT PARAMETER pcData AS CHARACTER NO-UNDO.
SHOW-STATS.
iLoop = iLoop + 1.
IF iLoop = 100 THEN
RETURN.
RUN TestProc IN THIS-PROCEDURE (cData). /* recursively call myself to generate useful stack info */
END PROCEDURE.