提交 0e9a7854 authored 作者: Thomas Mueller Graf's avatar Thomas Mueller Graf

Garbage collection of unused chunks should now be faster.

上级 06dc8538
...@@ -21,6 +21,8 @@ Change Log ...@@ -21,6 +21,8 @@ Change Log
<h2>Next Version (unreleased)</h2> <h2>Next Version (unreleased)</h2>
<ul> <ul>
<li>Garbage collection of unused chunks should now be faster.
</li>
<li>Prevent people using unsupported combination of auto-increment columns and clustering mode. <li>Prevent people using unsupported combination of auto-increment columns and clustering mode.
</li> </li>
<li>Support for DB2 time format, patch by Niklas Mehner <li>Support for DB2 time format, patch by Niklas Mehner
......
...@@ -279,6 +279,8 @@ public class MVStore { ...@@ -279,6 +279,8 @@ public class MVStore {
private long lastTimeAbsolute; private long lastTimeAbsolute;
private long lastFreeUnusedChunks;
/** /**
* Create and open the store. * Create and open the store.
* *
...@@ -1051,13 +1053,16 @@ public class MVStore { ...@@ -1051,13 +1053,16 @@ public class MVStore {
} }
private long storeNowTry() { private long storeNowTry() {
long time = getTimeSinceCreation();
int freeDelay = retentionTime / 10;
if (time >= lastFreeUnusedChunks + freeDelay) {
lastFreeUnusedChunks = time;
freeUnusedChunks(); freeUnusedChunks();
}
int currentUnsavedPageCount = unsavedMemory; int currentUnsavedPageCount = unsavedMemory;
long storeVersion = currentStoreVersion; long storeVersion = currentStoreVersion;
long version = ++currentVersion; long version = ++currentVersion;
setWriteVersion(version); setWriteVersion(version);
long time = getTimeSinceCreation();
lastCommitTime = time; lastCommitTime = time;
retainChunk = null; retainChunk = null;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论