aboutsummaryrefslogtreecommitdiff
path: root/matrix/matrix.go
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2019-06-16 14:29:03 +0300
committerTulir Asokan <tulir@maunium.net>2019-06-16 14:54:12 +0300
commit2b7d5d54011ffcc93511bf05f44163a4b7a1270c (patch)
tree48a88e26a12f04b3f922c9ec54c4e2db061125fb /matrix/matrix.go
parent6bb932212cbadac6eed59ac153ebe041523f7570 (diff)
Fix reply rendering infinite loop bug
Diffstat (limited to 'matrix/matrix.go')
-rw-r--r--matrix/matrix.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/matrix/matrix.go b/matrix/matrix.go
index 1a75f96..cfd5614 100644
--- a/matrix/matrix.go
+++ b/matrix/matrix.go
@@ -29,7 +29,9 @@ import (
"path"
"path/filepath"
"regexp"
+ "runtime"
"time"
+ dbg "runtime/debug"
"maunium.net/go/mautrix"
"maunium.net/go/mautrix/format"
@@ -232,6 +234,11 @@ func (c *Container) OnLogin() {
debug.Print("Adding rooms to UI")
c.ui.MainView().SetRooms(c.config.Rooms)
c.ui.Render()
+ // The initial sync can be a bit heavy, so we force run the GC here
+ // after cleaning up rooms from memory above.
+ debug.Print("Running GC")
+ runtime.GC()
+ dbg.FreeOSMemory()
}
c.client.Syncer = c.syncer