From 6ffef726082fd114c3dc05e16252bfdca292e23f Mon Sep 17 00:00:00 2001 From: Keloran Date: Fri, 13 Nov 2026 23:07:43 +0000 Subject: [PATCH] perf(config): free 1Password SDK memory after boot (TL-894) Co-Authored-By: Claude Opus 5.5 --- internal/config/config.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/config/config.go b/internal/config/config.go index 0aa4f26..5866be0 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -8,6 +8,7 @@ import ( "fmt" "io/fs" "os" + "runtime/debug" "strconv" bugfixes "github.com/bugfixes/go-bugfixes" @@ -55,6 +56,9 @@ func Build() (*Config, error) { if err := onepassword.Load("tracklines", secrets); err != nil { return nil, fmt.Errorf("1password: %w", err) } + // The 1Password SDK runs in a WASM engine that leaves ~100MB of garbage behind; hand it back to + // the OS now rather than paying Railway for it until the heap grows into it. + debug.FreeOSMemory() l, err := local.Build() if err != nil { return nil, fmt.Errorf("local: %w", err)