提交 4f4b38c6 authored 作者: Thomas Mueller's avatar Thomas Mueller

The NIO cleaner hack wasn't working as expected, because the clear method was…

The NIO cleaner hack wasn't working as expected, because the clear method was called instead of the clean method. This has been fixed. Please note this hack is not enabled by default, to try it you need to set the system property "h2.nioCleanerHack" to true.
上级 3f382525
...@@ -64,8 +64,10 @@ public class FileObjectDiskMapped implements FileObject { ...@@ -64,8 +64,10 @@ public class FileObjectDiskMapped implements FileObject {
Method cleanerMethod = mapped.getClass().getMethod("cleaner"); Method cleanerMethod = mapped.getClass().getMethod("cleaner");
cleanerMethod.setAccessible(true); cleanerMethod.setAccessible(true);
Object cleaner = cleanerMethod.invoke(mapped); Object cleaner = cleanerMethod.invoke(mapped);
Method clearMethod = cleaner.getClass().getMethod("clear"); if (cleaner != null) {
clearMethod.invoke(cleaner); Method clearMethod = cleaner.getClass().getMethod("clean");
clearMethod.invoke(cleaner);
}
useSystemGc = false; useSystemGc = false;
} catch (Throwable e) { } catch (Throwable e) {
// useSystemGc is already true // useSystemGc is already true
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论