KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: How to programatically retrieve the database cache size allocated by 4D?
PRODUCT: 4D | VERSION: 2004.2 | PLATFORM: Mac & Win
Published On: December 5, 2005
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

To get the current database memory cache size, use the "Get database parameter" command. This command accepts a selector parameter and returns the function results. To obtain the memory cache size, pass in the constant "Database Cache Size" or the value 9. The command will return the current cache size in bytes. To obtain the cache size in kilobytes, divide the result by 1024.
For example:

C_Longint($cacheSize,$cacheSizeKilo)
C_Text($textCacheSize)

$cacheSize:=Get database parameter(Database Cache Size)
$cacheSizeKilo:=$cacheSize/1024
$textCacheSize:=String($cacheSizeKilo) + " Kb"

To find more information about the command go to https://www.4d.com/docs/CMU/CMU00643.HTM.