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

SAP Sybase SQL Anywhere 16.0 » UltraLite - Database Management and Reference » UltraLite performance tips


Cache size adjustment for an UltraLite database

Although explicitly adjusting the cache size is not required, you typically want to adjust the cache size when your UltraLite database application is requested to reduce its memory usage by the operating system on mobile devices.

UltraLite database cache sizes increase dynamically in response to data operations and as available device memory allows within the parameters you specify. Normally you do not need to specify any parameters. If your database is large (400 MB for instance), you may want to specify the CACHE_MAX_SIZE parameter to raise the maximum limit beyond the default. UltraLite allocates some data structures based on the maximum cache size, so the default is not extremely large: you must explicitly request a large maximum to incur this extra memory overhead. There is no benefit to specifying a maximum cache size that is much larger than your maximum actual database file size.

UltraLite does not shrink the cache automatically. The database cache size can only be controlled explicitly in your application with the cache_allocation database option. In response to a low memory event raised by the operating system, adjust the cache_allocation database option after connecting to the database.


Dynamic cache sizing is not supported by UltraLite Java edition databases. For more information about UltraLite Java edition database cache sizes, see UltraLite Java edition database cache sizes.

 See also