swirl
Guide to OmniMark 7   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

The current version of OmniMark uses the garbage collector only to manage memory for records. If you do not use records in your request servicing code, there is no value to calling collect-garbage. Future version of OmniMark may use garbage collection for managing other data types.

      Related Concepts
   Records
 
 

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

OmniMark 7.1.2 Documentation Generated: June 28, 2005 at 5:45:00 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © Stilo Corporation, 1988-2005.