tcl.shpstat Verb: Access/TCL


Command tcl.shpstat Verb: Access/TCL
Applicable release versions: AP 6.0, AP 6.1
Category TCL (746)
Description examines or changes the status of shared Pick/BASIC programs that have been compiled with FlashBASIC.

The default behavior of "shpstat" is to list the status of all FlashBASIC programs currently running in shared memory. The following statistics are displayed:

"Block" is the memory block number.

"Usage" is the total number of users currently executing the program.

"Size" is the total size (in bytes) of the memory block.

"Name" is the Pick/BASIC program name. If the memory block is available, this column displays "( free )".

At the end of the listing, the following statistics are shown:

Free. This gives the total free space in shared program memory. Initially, this number should be slightly smaller than the number specified in the "pick0" configuration file. A program requires a contiguous block of memory to load and free space may become fragmented. Therefore, a given program may not load even though the total amount of free space seems sufficient.

"Max Free" is the largest contiguous free block available to the system. Since FlashBASIC programs must be loaded into a single block, this indicates the maximum size of a program that can be accommodated at the present moment.

"Used" is the total number of bytes used by all shared loaded modules. Use this to determine the amount of shared Pick/BASIC space required. Initially, the machine should be booted with a large shared memory space, then brought up to normal usage. The total shared memory may then be examined. Then, shut down the machine, resize the "basic" option in the "pick0" file accordingly, and reboot. The basic shared memory segment should now be properly sized for your system.

If "shpstat" is invoked with the "l" option, the list is displayed interactively with the following added options:

< Scrolls back one page.

> Scrolls forward one page.

i Initializes shared program memory. This should be used only in the event of serious problems. It completely cleans out shared program memory, causing any users currently executing within it to abort.

k Kills a module. This option is used to free a module from memory if no one is currently using it, to free up some shared space. Any users executing a module which is killed will display "undefined behavior", which could involve aborting.

q Quits the program.

r Refreshes the screen to reflect the current memory status.

s Sets the sleep period in between updates. Smaller sleep times will give a more accurate view of system performance, but will also use more resources.

The program displays some useful statistics at the bottom of the screen:

"Current Page". This shows part of the program list that is currently being displayed.

"Total Number of Pages" is the number of screens the entire list takes. "<" and ">" scrolls through the pages.

"Sleep Time" is the current sleep period in seconds.

To reduce fragmentation, "sticky" programs start loading at the high end of shared memory, while "non-sticky" programs load at the bottom. Often-used programs may be compiled with the "k" option to make them "sticky".
Syntax shpstat {(options)}
Options i Initializes the entire shared program status area. This should be used only in case of emergencies. It causes all programs running in the shared area to abort. When used with this option, "shpstat" clears the memory and completes. No status information is displayed.


Loops on displaying status information. This repeatedly updates the status information displayed on the screen. The default time between updates is 5 seconds. The "l" option may be followed by a number to override the default delay time between loops.

p Directs the output to the system printer, via the Spooler.

s Suppresses detail output when used without the (l option (6.1.0 and above only).

z "Zaps" shared program memory. This is a stronger version of the "i" option.
shpstat (l1

This causes the status program to redisplay the current status of shared 
programs every second.  This setting causes a very noticeable drain on system 
performance and should only be used when tuning or if problems occur.

shpstat (i

This completely reinitializes memory.  This may be used if  several processes 
running shared code have aborted abnormally, and the shared memory table seems 
corrupted.  Signs of corruption include long wait times when loading programs, 
and having "shpstat" with no options seem to hang indefinitely.

Block  Usage   Size  Name
1      1    106k  REPORT.bp
2      1     15k  REPORT.bp
3      1      3k  REPORT.bp btree.root
4      1      8k  cmarc.library
5      1     18k  cmarc.library
6      1      7k  cmarc.library
7      1     27k  REPORT.bp eep.format.doc
8         2,374k  (free)

Free:  2,374k     Max Free:  2,374k     Used:    185k
Related tcl.term