Kill RootSession on low memory

This commit is contained in:
Mygod
2018-09-07 10:43:40 +08:00
parent 9bc59ac270
commit 22b4dd6438
2 changed files with 12 additions and 0 deletions

View File

@@ -46,6 +46,12 @@ class RootSession : AutoCloseable {
instance.haltTimeout()
return instance.Transaction()
}
fun trimMemory() = monitor.withLock {
val instance = instance ?: return
instance.haltTimeout()
instance.close()
}
}
class UnexpectedOutputException(msg: String) : RuntimeException(msg)