hardHeapLimit

Queries or sets the hard upper bound on the amount of memory that can be allocated by SQLite.

This pragma sets a strict limit, in bytes, on the total memory that sqlite3_malloc() and sqlite3_realloc() will allocate. If an allocation exceeded this limit, it fails, and SQLite may return an SQLITE_NOMEM error.

A value of 0 (the default) disables the hard limit.

This limit is a global setting for the entire process, not just the current database connection. Setting it from any thread affects all SQLite connections in the application. It provides a safety net to prevent the application from consuming excessive memory due to large queries or database operations.

Author

MOHAMMAD AZIM ANSARI

See also