PRAGMA hard_heap_limit
This pragma invokes the sqlite3_hard_heap_limit64() interface with the argument N, if N is specified and N is a positive integer that is less than the current hard heap limit.
PRAGMA hard_heap_limit PRAGMA hard_heap_limit=N
What the SQLite documentation says
This pragma invokes the sqlite3_hard_heap_limit64() interface with the argument N, if N is specified and N is a positive integer that is less than the current hard heap limit. The hard_heap_limit pragma always returns the same integer that would be returned by the sqlite3_hard_heap_limit64(-1) C-language function. That is to say, it always returns the value of the hard heap limit that is set after any changes imposed by this PRAGMA.
This pragma can only lower the heap limit, never raise it. The C-language interface sqlite3_hard_heap_limit64() must be used to raise the heap limit.
See also the soft_heap_limit pragma.
From sqlite.org's pragma documentation for SQLite 3.54.1, in the public domain.