logo

SQLite C Interface: Impose A Limit On Heap Size

日期:2008-02-12 21:09 , 点击:256 , 分类:Sqlite新闻
相关标签:soft_heap_limit,



SQLite C Interface

Impose A Limit On Heap Size

void sqlite3_soft_heap_limit(int);

The sqlite3_soft_heap_limit() interface places a "soft" limit on the amount of heap memory that may be allocated by SQLite. If an internal allocation is requested that would exceed the soft heap limit, sqlite3_release_memory() is invoked one or more times to free up some space before the allocation is made.

The limit is called "soft", because if sqlite3_release_memory() cannot free sufficient memory to prevent the limit from being exceeded, the memory is allocated anyway and the current operation proceeds.

A negative or zero value for N means that there is no soft heap limit and sqlite3_release_memory() will only be called when memory is exhausted. The default value for the soft heap limit is zero.

SQLite makes a best effort to honor the soft heap limit. But if the soft heap limit cannot honored, execution will continue without error or notification. This is why the limit is called a "soft" limit. It is advisory only.

Prior to SQLite version 3.5.0, this routine only constrained the memory allocated by a single thread - the same thread in which this routine runs. Beginning with SQLite version 3.5.0, the soft heap limit is applied to all threads. The value specified for the soft heap limit is an upper bound on the total memory allocation for all threads. In version 3.5.0 there is no mechanism for limiting the heap usage for individual threads.

See also lists of Objects, Constants, and Functions.



SQLite C Interface: Impose A Limit On Heap Size 评论

# 昵称:

# 邮箱:

# 标题:

* 请勿发布任何违反国家互联网相关法律法规的内容

    



站内搜索




* 匹配全部


热门排行


最新内容



Copyright © 2008 Sqlite中文实验室 版权所有
蜀ICP备08000081号 -

Powered By xydw.com Page Loaded in:0.450909s