KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: About command the MEMORY STATISTICS
PRODUCT: 4D | VERSION: 20 R | PLATFORM: Mac & Win
Published On: September 8, 2025


Starting 4D 20 R7, the command GET MEMORY STATISTICS has been renamed to MEMORY STATISTICS.

The main reason for this change is because the command has "a “Get” prefix but [...] no corresponding “Set” command."

You can read more about this change in this blog post.

Here is a quick method that alerts the values returned by this command:

ARRAY TEXT($arrNames; 0)
ARRAY REAL($arrValues; 0)
ARRAY REAL($arrCount; 0)
var $log_o : Object
var $i : Integer
var $text : Text

MEMORY STATISTICS(1; $arrNames; $arrValues; $arrCount)

$log_o:=New object
$log_o.timestamp:=String(Current date;ISO date GMT; Current time)
$log_o.memory:=New object

For ($i; 1; Size of array($arrNames))
  $log_o.memory[$arrNames{$i}]:=New object("value"; $arrValues{$i}; "count";   $arrCount{$i})
End for

$text:=JSON Stringify($log_o; *)
ALERT($text)