ui: further reduce log viewer memory usage

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2023-04-12 13:48:55 +02:00
parent 8c6c909e98
commit 8152191277

View File

@ -158,7 +158,6 @@ class LogViewerActivity : AppCompatActivity() {
builder.append('\n') builder.append('\n')
} }
val ret = builder.toString().toByteArray(Charsets.UTF_8) val ret = builder.toString().toByteArray(Charsets.UTF_8)
builder.clear()
return ret return ret
} }
@ -203,7 +202,7 @@ class LogViewerActivity : AppCompatActivity() {
var priorModified = false var priorModified = false
val bufferedLogLines = arrayListOf<LogLine>() val bufferedLogLines = arrayListOf<LogLine>()
var timeout = 1000000000L / 2 // The timeout is initially small so that the view gets populated immediately. var timeout = 1000000000L / 2 // The timeout is initially small so that the view gets populated immediately.
val MAX_LINES = (1 shl 17) - 1 val MAX_LINES = (1 shl 16) - 1
val MAX_BUFFERED_LINES = (1 shl 14) - 1 val MAX_BUFFERED_LINES = (1 shl 14) - 1
while (true) { while (true) {