4D v16.3

Cache info

Home

 
4D v16.3
Cache info

Cache info 


 

Cache info {( dbFilter )} -> Function result 
Parameter Type   Description
dbFilter  Object in Defines list of attributes to be returned (filtered per DB)
Function result  Object in Information about cache

This command only works in 4D 64-bit versions.

The Cache info command returns an object that contains detailed information about the current cache contents (used memory, loaded tables and indexes, etc.)

Note: This command only works in local mode (4D Server and 4D); it must not be used from 4D in remote mode.

By default, returned information refers to the running database only. The optional dbFilter object parameter allows you to specify the scope of the command:

  • pass the "dbFilter" attribute with the "All" value to get cache information about all running databases, including components.
  • pass the "dbFilter" attribute with a "" (empty string) value to get information about the current database only (equivalent to omitting the dbFilter parameter). 

The Cache info command returns a single object that contains all the relevant information about the cache. The returned object has the following basic structure:

{
    "maxMem": Maximum cache size (real),
    "usedMem": Current cache size (real),
    "objects": [...] Array of objects currently loaded in cache
}

Elements of the objects array are root objects (tables, indexes, Blobs, etc.) which are currently loaded in the cache. Each element contains specific attributes that describe its current status. For more information about advanced interpretation of this data, please contact your local Technical Service department.

Example  

You want to get cache information for the current database:

 C_OBJECT($cache)
 $cache:=Cache info

You want to get cache information for the database and all opened components:

 C_OBJECT($dbFilter)
 OB SET($dbFilter;"dbFilter";"All")
 $cache:=Cache info($dbFilter)



See also 

GET MEMORY STATISTICS

 
PROPERTIES 

Product: 4D
Theme: Cache Management
Number: 1402

This command can be run in preemptive processesFeature(s) not available in 4D 32 bits

 
HISTORY 

New
Created: 4D v16

 
ARTICLE USAGE

4D Language Reference ( 4D v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)