Log In    |    Knowledge Base    |    4D Home
Tech Tip: Checking Memory with the Runtime Explorer and the Debugger
Published On: August 6, 1999

The new Runtime Explorer feature introduced in 4D v6.5 can help you diagnose your memory usage. From 4D Client, 4D Server, or a standalone version of 4D, you can display the Runtime Explorer by using a special keystroke: on Windows use Ctrl-Shift-F9, and on Macintosh use Command-Shift-F9.

In the Watch page of the Runtime Explorer, open up the hierarchical listing for "Information." An item in that section displays the amount of "Free Memory," measured in kilobytes. You can also view this information in the Watch Pane in the upper-left corner of the Debugger. As you run various operations, you can watch the changes in the amount of free memory available. If you were to attempt an operation that requires more memory than the amount of free memory available, an out-of-memory condition will occur.

In the Runtime Explorer, you can adjust the rate at which the values displayed are refreshed by changing the refresh rate setting at the top of the window. In either location, if you click on the values displayed, you can force them to refresh faster than they otherwise would.

The actual size of the data cache that is created when your database runs will depend not only on the memory settings accessed in the Database Properties dialog and through Customizer Plus, but also on the current system resources.

The actual size of the data cache in a running database is displayed in the Watch page of the Runtime Explorer and in the Watch Pane of the Debugger. In the "Cache Statistics" section, you'll see a value displayed such as "112 bytes / 9 636 Kb (0%), 6 handles." In this example, the size of the memory allocated to the data cache is 9636 Kb.

By using the Get database parameter command with the value 9 for the selector parameter, your code can programmatically find the actual size of the memory allocated to the data cache in a running database, measured in bytes.