Skip to main content

This documentation is for an older version of this product. See the latest version of this content.Opens in a new tab

Determining Sizes of Globals

InterSystems IRIS® data platform provides tools you can use to measure the size of any global.

^%GSIZE Routine

The ^%GSIZE routine enables you to determine the size of one or more globals. To use this routine:

  1. Start an ObjectScript shell.

  2. Start the routine:

     do ^%GSIZE
    
  3. The first prompt lets you specify the database to look at. The prompt refers to the directory that contains the database file:

    Directory name: c:\intersystems\iris211\mgr\enslib\ =>
    

    The default is the globals database used by the namespace that you are currently in. You can either press Enter to accept this default, or type a full directory name and then press Enter.

  4. The next prompt is as follows:

    All Globals? No =>
    

    If you want information on all globals, enter Y (case-insensitive). Otherwise press Enter.

    Note:

    If you request information on all globals, that includes all the internal, undocumented globals as well as your own globals. Some of these are quite large.

  5. If you did not enter Y in the previous step, the next prompt looks like the following, which is asking for a global name:

    Global ^
    

    Type the global name, without the leading caret and press Enter.

    Repeat as necessary. When you are done entering global names, press Enter again. Then the routine displays a message indicating how many globals you have selected:

    All Globals? No => No
    Global ^IRIS.Msg
    Global ^Ens.Config
    Global ^
    2 globals selected from 64 available globals.
    
  6. The next prompt asks whether to provide a full report on the globals:

    Show details?? No =>
    

    If you want full information, enter Y (case-insensitive). Otherwise press Enter

  7. Press Enter for the next two prompts, which let you specify where to write the output:

    Device:
    

    and

    Right margine: 80 =>
    
  8. The routine then displays output like the following (using N for the Show details prompt):

               Global Size Display of c:\intersystems\iris211\mgr\enslib\
                                  2:44 PM  Aug 15 2024
     
      Ens.Config       1    IRIS.Msg     906
     
          TOTAL:     907
    
    

    When using Y for the Show details prompt, the report looks like this instead:

               Global Size Display of c:\intersystems\iris211\mgr\enslib\
                                  2:44 PM  Aug 15 2024
     
      Ens.Config       1    IRIS.Msg     906
     
          TOTAL:     907
    directory: c:\intersystems\iris211\mgr\enslib\
    Page: 1                           GLOBAL SIZE                        15 Aug xxxx
                                                                             2:42 PM
          Global        Blocks       Bytes Used  Packing   Contig.
          --------    --------  ---------------  -------   -------
          Ens.Config         1               36      0 %         0
          IRIS.Msg         906        5,550,960     75 %       746
     
     
          TOTAL         Blocks       Bytes Used  Packing   Contig.
          --------    --------  ---------------  -------   -------
                           907        5,550,996     75 %       746
                                            <RETURN> to continue or '^' to STOP:
    

APIs for Getting Global Sizes

Several classes provide APIs for getting sizes of globals:

See Also

FeedbackOpens in a new tab