Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 17 » SQL Anywhere Server - Database Administration » SQL Anywhere database server executable (dbsrv17, dbeng17) » Database server startup options

-c database server option

Sets the initial memory reserved for caching database pages and other database server information.

dbsrv17 -c { size[ k | m | g | p ] } ...
Applies to

All operating systems.


The amount of memory available for use as a database server cache is one of the key factors controlling performance. You can set the initial amount of cache memory using the -c server option. The more cache memory that can be given to the database server, the better its performance.

The size is the amount of memory, in bytes. Use k, m, or g to specify units of kilobytes, megabytes, or gigabytes, respectively.

The unit p is a percentage either of the total physical system memory, or of the maximum supported cache size, whichever is lower. The maximum supported cache size depends on the operating system. For example:

  • 2.5 GB for Windows 32-bit Advanced Server, Enterprise Server, and Datacenter Server

  • 3.5 GB for the 32-bit database server running on Windows x64 Edition

  • 1.5 GB on all other 32-bit Windows operating systems

  • On 64-bit database servers, the cache size can be considered unlimited

If you use p, the argument is a percentage. You can use % as an alternative to p, but in Windows batch files and some alternate Windows command shells, you must escape the % character by doubling it. For example, to set the initial cache size to 50 percent of the physical system memory from a batch file, use a command like the following:

dbspawn dbsrv17 -c 50%% ...

If no -c option is provided, the database server calculates the initial cache allocation as follows:

  • Windows

    The formula is as follows:

    max( 2 MB, min( dbsize, 0.25*TotalPhysicalMemory ) );

    The dbsize is the total size of the database file or files started, and TotalPhysicalMemory is the total amount of physical memory on the computer.

  • Unix

    At least 8 MB.

    max( 8 MB, min( 0.1*( physical-memory + available-swap ) , database-size*1.1 )
Note If you attempt to set your initial or minimum cache sizes to a value that is less than one eighth of the maximum cache size, the initial and minimum cache sizes are automatically increased relative to the maximum cache size.

If you disable dynamic cache resizing (-ca option), then the cache size that is used may be restricted by the amount of memory that is available.

The database server messages window displays the size of the cache at startup and you can use the following statement to obtain the current size of the cache:

SELECT PROPERTY( 'CurrentCacheSize' );


The following example starts a database server named myserver that starts with a cache size of 3 MB and loads the sample database:

dbsrv17 -c 3m -n myserver "%SQLANYSAMP17%\demo.db"