提交 6b871e87 authored 作者: Thomas Mueller's avatar Thomas Mueller

avoid out of memory

上级 07d12daf
...@@ -52,6 +52,8 @@ public class Cache2Q implements Cache { ...@@ -52,6 +52,8 @@ public class Cache2Q implements Cache {
headMain.next = headMain.previous = headMain; headMain.next = headMain.previous = headMain;
headIn.next = headIn.previous = headIn; headIn.next = headIn.previous = headIn;
headOut.next = headOut.previous = headOut; headOut.next = headOut.previous = headOut;
// first set to null - avoiding out of memory
values = null;
values = new CacheObject[len]; values = new CacheObject[len];
sizeIn = sizeOut = sizeMain = 0; sizeIn = sizeOut = sizeMain = 0;
recordCount = 0; recordCount = 0;
......
...@@ -39,6 +39,8 @@ public class CacheLRU implements Cache { ...@@ -39,6 +39,8 @@ public class CacheLRU implements Cache {
public void clear() { public void clear() {
head.next = head.previous = head; head.next = head.previous = head;
// first set to null - avoiding out of memory
values = null;
values = new CacheObject[len]; values = new CacheObject[len];
recordCount = 0; recordCount = 0;
sizeMemory = 0; sizeMemory = 0;
......
...@@ -281,6 +281,8 @@ java org.h2.test.TestAll timer ...@@ -281,6 +281,8 @@ java org.h2.test.TestAll timer
/* /*
truncate in-memory file system after each test
split files (1 GB max size) split files (1 GB max size)
Windows service Wrapper not starting because of incorrect classpath Windows service Wrapper not starting because of incorrect classpath
......
...@@ -217,8 +217,10 @@ public abstract class TestBase { ...@@ -217,8 +217,10 @@ public abstract class TestBase {
url += ";TRACE_LEVEL_SYSTEM_OUT=2"; url += ";TRACE_LEVEL_SYSTEM_OUT=2";
} }
if (config.traceLevelFile > 0 && admin) { if (config.traceLevelFile > 0 && admin) {
if (url.indexOf("TRACE_LEVEL_FILE=") < 0) {
url += ";TRACE_LEVEL_FILE=" + config.traceLevelFile; url += ";TRACE_LEVEL_FILE=" + config.traceLevelFile;
} }
}
if (config.throttle > 0) { if (config.throttle > 0) {
url += ";THROTTLE=" + config.throttle; url += ";THROTTLE=" + config.throttle;
} }
......
...@@ -42,7 +42,7 @@ public class TestPowerOff extends TestBase { ...@@ -42,7 +42,7 @@ public class TestPowerOff extends TestBase {
} else { } else {
dir = "memFS:"; dir = "memFS:";
} }
url = dir + "/" + dbName + ";file_lock=no"; url = dir + "/" + dbName + ";FILE_LOCK=NO;TRACE_LEVEL_FILE=0";
testSummaryCrash(); testSummaryCrash();
testCrash(); testCrash();
testShutdown(); testShutdown();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论