maybe fix some memory bloat issues
This commit is contained in:
@@ -40,9 +40,9 @@ func main() {
|
|||||||
log.F.F("SUPERUSER is not set")
|
log.F.F("SUPERUSER is not set")
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
runtime.GOMAXPROCS(1)
|
runtime.GOMAXPROCS(4)
|
||||||
debug.SetGCPercent(10)
|
debug.SetGCPercent(10)
|
||||||
debug.SetMemoryLimit(250000)
|
debug.SetMemoryLimit(2500000)
|
||||||
var err error
|
var err error
|
||||||
a := cfg.Superuser
|
a := cfg.Superuser
|
||||||
var dst []byte
|
var dst []byte
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ func (a *A) HandleAuth(b []byte, srv interfaces.Server) (msg []byte) {
|
|||||||
var accepted bool
|
var accepted bool
|
||||||
if accepted, msg = a.Server.AddEvent(context.Bg(), ev, a.Listener.Request, a.Listener.AuthedBytes(),
|
if accepted, msg = a.Server.AddEvent(context.Bg(), ev, a.Listener.Request, a.Listener.AuthedBytes(),
|
||||||
a.Listener.RealRemote()); accepted {
|
a.Listener.RealRemote()); accepted {
|
||||||
log.I.F("saved event %0x", ev.Id)
|
log.W.F("saved event %0x", ev.Id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package socketapi
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"runtime/debug"
|
||||||
|
|
||||||
"realy.lol/chk"
|
"realy.lol/chk"
|
||||||
"realy.lol/envelopes"
|
"realy.lol/envelopes"
|
||||||
@@ -40,5 +41,5 @@ func (a *A) HandleMessage(msg []byte, remote string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
debug.FreeOSMemory()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user