swirl
Guide to OmniMark 9   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
    Related Concepts  
action  

collect-garbage

 
 

Syntax

collect-garbage
    


Purpose

You can use the collect-garbage to force OmniMark to perform garbage collection at the most appropriate time in your program.

OmniMark performs garbage collection automatically, so the use of collect-garbage is never required. Using it indiscriminately can also increase program execution time by forcing unnecessary garbage collection. The only time that it is appropriate to call collect-garbage is in a situation where you need a particular section of code to run as fast as possible, even if that makes the rest of the program run more slowly. Typically, this will occur in a server program that spends some portion of its time idle and some part of its time processing requests. You can use collect-garbage to force OmniMark to perform garbage collection in an idle period rather than during the processing of a request. To do this, you would place collect-garbage after the processing of the request and before the end of the request loop. (Do not place it at the start of the loop or garbage collection time will be added to the request processing time.)

  process
     ; establish server
     repeat
        ; receive connection
        ; process request
        collect-garbage
     again
          

OmniMark uses the garbage collector only to manage memory for instances of records data types: collect-garbage has no effect on instances of built-in data types or those of opaque data types. If you do not use records data types in your request servicing code, there is no value to calling collect-garbage.

      Related Concepts
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACY LIBRARIES ] [ ERRORS ]

OmniMark 9.1.0 Documentation Generated: September 2, 2010 at 1:51:21 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2010.