提交 f7f92bd7 authored 作者: Thomas Mueller's avatar Thomas Mueller

The database file size grows now 35%, but at most 256 MB at a time.

上级 2f0980a4
......@@ -248,10 +248,10 @@ public class DbSettings extends SettingsBase {
/**
* Database setting <code>PAGE_STORE_MAX_GROWTH</code>
* (default: Integer.MAX_VALUE).<br />
* (default: 128 * 1024).<br />
* The maximum number of pages the file grows at any time.
*/
public final int pageStoreMaxGrowth = get("PAGE_STORE_MAX_GROWTH", Integer.MAX_VALUE);
public final int pageStoreMaxGrowth = get("PAGE_STORE_MAX_GROWTH", 128 * 1024);
/**
* Database setting <code>PAGE_STORE_INTERNAL_COUNT</code>
......
......@@ -122,7 +122,7 @@ public class PageStore implements CacheWriter {
private static final int PAGE_ID_META_ROOT = 4;
private static final int MIN_PAGE_COUNT = 6;
private static final int INCREMENT_KB = 1024;
private static final int INCREMENT_PERCENT_MIN = 20;
private static final int INCREMENT_PERCENT_MIN = 35;
private static final int READ_VERSION = 3;
private static final int WRITE_VERSION = 3;
private static final int META_TYPE_DATA_INDEX = 0;
......@@ -1141,7 +1141,7 @@ public class PageStore implements CacheWriter {
increment = (1 + (percent / increment)) * increment;
}
int max = database.getSettings().pageStoreMaxGrowth;
if (increment > max) {
if (max < increment) {
increment = max;
}
increaseFileSize(increment);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论