control/controlclient: free memory on iOS before full netmap work
Updates tailscale/corp#18514 Change-Id: I8d0330334b030ed8692b25549a0ee887ac6d7188 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
e0f97738ee
commit
f45594d2c9
|
@ -11,6 +11,8 @@ import (
|
||||||
"maps"
|
"maps"
|
||||||
"net"
|
"net"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
"runtime"
|
||||||
|
"runtime/debug"
|
||||||
"slices"
|
"slices"
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
@ -187,6 +189,12 @@ func (ms *mapSession) HandleNonKeepAliveMapResponse(ctx context.Context, resp *t
|
||||||
// our UpdateFullNetmap call). This is the part we tried to avoid but
|
// our UpdateFullNetmap call). This is the part we tried to avoid but
|
||||||
// some field mutations (especially rare ones) aren't yet handled.
|
// some field mutations (especially rare ones) aren't yet handled.
|
||||||
|
|
||||||
|
if runtime.GOOS == "ios" {
|
||||||
|
// Memory is tight on iOS. Free what we can while we
|
||||||
|
// can before this potential burst of in-use memory.
|
||||||
|
debug.FreeOSMemory()
|
||||||
|
}
|
||||||
|
|
||||||
nm := ms.netmap()
|
nm := ms.netmap()
|
||||||
ms.lastNetmapSummary = nm.VeryConcise()
|
ms.lastNetmapSummary = nm.VeryConcise()
|
||||||
ms.occasionallyPrintSummary(ms.lastNetmapSummary)
|
ms.occasionallyPrintSummary(ms.lastNetmapSummary)
|
||||||
|
|
Loading…
Reference in New Issue