FunctionPackage: windowsToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.0
Unrevised from 9.0 to 10.0.
9.0 version


Arguments: nil

Returns a property list whose keys are keyword symbols identifying information about status of memory (:percent-used, :total-physical, :available-physical, etc.) and whose values are the associated values.

This function simply links to the MS Windows function described here:, click on the MEMORYSTATUS structure (we cannot guarantee this link will remain valid). The Lisp function source is here:

(defun memory-status ()
  (declare (optimize (speed 3) (safety 1))) ; for dynamic extent
  (with-stack-fobject (struct 'memorystatus)
    (setf (fslot-value-typed 'memorystatus :foreign struct 'dwLength)
        (get-foreign-type 'memorystatus))))
    (GlobalMemoryStatus struct)
     (- 100
        (/ (round
            (* 100 ;; this is to round to two decimal places
               (/ (* 100.0
                     (+ (fslot-value-typed 'memorystatus :foreign struct
                        (fslot-value-typed 'memorystatus
                                           :foreign struct 'dwAvailPageFile)))
                  (+ (fslot-value-typed 'memorystatus
                                        :foreign struct 'dwTotalPhys)
                     (fslot-value-typed 'memorystatus
                                        :foreign struct 'dwTotalPageFile)))))
     :total-physical (fslot-value-typed 'memorystatus :foreign struct
     :available-physical (fslot-value-typed 'memorystatus :foreign struct
     :total-paging (fslot-value-typed 'memorystatus :foreign struct
     (fslot-value-typed 'memorystatus :foreign struct 'dwAvailPageFile)
     (fslot-value-typed 'memorystatus :foreign struct 'dwTotalVirtual)
     (fslot-value-typed 'memorystatus :foreign struct 'dwAvailVirtual)
     :load (fslot-value-typed 'memorystatus :foreign struct 'dwMemoryLoad))))

This function is defined in the :winapi module. If that module is not loaded, evaluate (require :winapi). This function is available on Windows machines only. In releases prior to 7.0, the symbol naming this function was exported from the common-graphics package. Starting in release 7.0, it is exported only from the windows package. This function is available in images into which the :winapi module has been loaded but the Common Graphics and IDE modules have not.

Copyright (c) 1998-2016, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 9.0 page.
Created 2015.5.21.

Allegro CL version 10.0
Unrevised from 9.0 to 10.0.
9.0 version