Cache Memory Settings

The Cache memory contains application data recently requested by users. AcctVantage Server performs its own data caching to optimize performance.

In AV 2018 (and previous versions), cache memory is limited to 2GB. This is due to a limitation with 4D and MacOS (32-bit architecture).

GOOD NEWS: In AV 2019, cache memory will be essentially unlimited!

In moving to 4D v17 for AV 2019, AcctVantage will become a 64 bit application. This means that AV can use more than 2GB of RAM, which will improve performance during memory-intensive tasks (e.g. Sales Summary, Inventory Statistics, etc.)

Referencing the screenshot below, you will still need to have some (1) memory to be reserved for applications and the system and you will still need to set the (2) percentage of memory used for cache. However, in AV 2019 the (3) maximum size can be increased essentially only limited by the amount of RAM on your server hardware. This may require some trial and error to find the perfect balance for your system.

About Cache Settings

In the Database Settings on the AV Server (File menu ➤ Database Settings ➤ Database tab ➤ Memory tab) there is a section where you can set application memory and database cache size.

There are two main configurations, Forced and Adaptive cache settings:

  • Adaptive: This is set when the checkbox Calculation of adaptive cache IS checked. This setting is a bit more versatile. Memory allocation is calculated dynamically and respects the limits you set.
  • (1) Memory to be reserved for other applications and for the system:
    • Portion of the RAM to reserve for the System and other applications. This value is increased for optimization when other applications are running on the same machine as 4D.
    • AV will be limited from accessing this amount of physical memory.
  • (2) Percentage of available memory used for cache:
    • Percentage of the remaining memory allocated to the cache by default.
    • The size of the memory cache varies dynamically depending on the needs of the application and the system.
    • To calculate the amount of cache that will be used: Take all physical RAM on your system, subtract the amount of memory in the above reserved setting, and then multiply by the percentage you place in this setting.
    • You can set limits using the following two options:
      • (3) Maximum Size: Maximum amount of memory that can be used by the cache. With a 32-bit version of 4D and 4D Server, this value is limited internally to 2000 MB (2 GB) for performance reasons. With a 64-bit version of 4D Server, this value is virtually unlimited.
      • Minimum Size: Minimum amount of memory that must be reserved for the cache. This value cannot be less than 4 MB.

Forced: This is set when the checkbox Calculation of adaptive cache is not checked. The database cache is set to this size regardless of the machine resources available.

  • In this mode, you set the size of the memory cache for the database yourself. 4D then displays an entry area that allows setting the memory cache to use as well as information related to the physical memory (RAM available on the machine), the current cache and cache after restart (taking your changes into account).
  • The size of the memory cache that you enter will be reserved for the 4D database, regardless of the state of machine resources. This setting can be used in certain specific configurations, or when the database is designed to be used on dissimilar systems in terms of memory. In most cases, the adaptive cache offers better performance.

Other settings:

  • Keep the cache in physical memory for 4D Server and 4D Volume Desktop:
    • This advanced option can be used to “force” the cache to be kept in the physical memory (RAM) of the machine when the database is executed by 4D Volume Desktop or 4D Server.
    • By default the cache can be flushed in part or entirely in the virtual memory of the machine when necessary (the virtual memory is an area set aside on the hard disk). Since this mechanism can, in certain cases, noticeably alter the performance of applications deployed with 4D Server or 4D  Volume Desktop, you can check this option in order for the cache to be kept permanently in physical memory. Of course, the machine configuration (size of RAM, number of applications running simultaneously, etc.) must be compatible with this principle.
    • Note: This option does not affect the operation of applications run on the same machine as the 4D application.
  • Flush Data Buffers every … Seconds/Minutes:
    • Specifies the time period between each automatic saving of the data cache, i.e., its writing to disk.
    • 4D saves the data placed in the cache at regular intervals. You can specify any time interval between 1 second and 500 minutes. By default, 4D saves your data every 20 seconds. The application also saves your data to disk each time you change to another environment or exit the application.
    • When you anticipate heavy data entry, consider setting a short time interval between saves. In case of a power failure, you will only lose the data entered since the previous save (if the database is running without a log file).
    • If there is a noticeable slowing down of the database each time the cache is flushed, you need to adjust the frequency. This slowness means that a huge amount of records is being saved. A shorter period between saves would therefore be more efficient since each save would involve fewer records and hence be faster.
    • By default, 4D displays a small window when the cache is flushed. If you do not want this visual reminder, you can uncheck the Flushing progress option on the Interface tab of the Database Settings.