Kopia server possible memory leak

kopia version:
0.23.1 build: 72ec08fd8edb86c67ed27099bf1b955e1f308ffa from: kopia/kopia

I use kopia server start to make a central repository to backup multiple computer.

GODEBUG=gctrace=1 GOMEMLIMIT=3GiB GOGC=1000 kopia server start --server-control-username=kopia --server-control-password=****************************** --address=0.0.0.0:51515 --tls-cert-file /home/kopia/my.cert --tls-key-file /home/kopia/my.key

The server is running continuously.

Logs:
starting session for user ****************************** from 192.168.254.1:37002
starting session for user ****************************** from 192.168.254.1:37002
starting session for user ****************************** from 192.168.254.3:58992
starting session for user ****************************** from 192.168.254.3:58992
session ended for user ****************************** from 192.168.254.3:58992
session ended for user ****************************** from 192.168.254.3:58992
starting session for user ****************************** from 192.168.254.3:58998
starting session for user ****************************** from 192.168.254.1:37002
starting session for user ****************************** from 192.168.254.3:58998
gc 4 @ 268.620s 0%: 0.86+442+0.030 ms clock, 3.4+51/395/870+0.12 ms cpu, 2071->2076->678 MB, 2082 MB goal, 0 MB stacks, 0 MB globals, 4 P

Much time later:
GC forced
gc 518 @ 66734.336s 0%: 0.10+1536+0.017 ms clock, 0.43+0/1535/0+0.071 ms cpu, 2539->2539->2152 MB, 2860 MB goal, 1 MB stacks, 0 MB globals, 4 P
GC forced
gc 519 @ 66869.428s 0%: 0.22+1571+0.018 ms clock, 0.89+0.25/1571/0+0.075 ms cpu, 2152->2152->2146 MB, 2820 MB goal, 1 MB stacks, 0 MB globals, 4 P
GC forced
gc 520 @ 67004.504s 0%: 0.096+1492+0.016 ms clock, 0.38+0.28/1492/0+0.066 ms cpu, 2366->2366->2159 MB, 2857 MB goal, 1 MB stacks, 0 MB globals, 4 P

The memory usage is keep getting incrasing and kopia not release the memory, even if the server is idle. If i restart the server than memory usage seems fine. If i not restart, than it is swapping until oom.

It is a known issue? How could i fix it? Thanks.

I started kopia server with --enable-pprof

1978.17MB 67.01% 67.01% 1978.17MB 67.01% encoding/json.(*RawMessage).UnmarshalJSON
355.10MB 12.03% 79.04% 355.10MB 12.03% reflect.mapassign_faststr0
189.04MB 6.40% 85.44% 189.04MB 6.40% github.com/kopia/kopia/internal/gather.(*chunkAllocator).allocChunk
97.50MB 3.30% 88.75% 98MB 3.32% encoding/json.(*decodeState).literalStore
89.51MB 3.03% 91.78% 89.51MB 3.03% reflect.New
58MB 1.96% 93.74% 58MB 1.96% reflect.MakeMapWithSize
46.43MB 1.57% 95.32% 46.43MB 1.57% github.com/kopia/kopia/internal/cache.(*contentMetadataHeap).Push
43.61MB 1.48% 96.80% 43.61MB 1.48% github.com/kopia/kopia/repo/manifest.(*committedManifestManager).mergeEntryLocked
36MB 1.22% 98.01% 2615.28MB 88.59% encoding/json.(*decodeState).object
25.50MB 0.86% 98.88% 25.50MB 0.86% github.com/kopia/kopia/repo/blob/sharded.(*Storage).ListBlobs.func1
0.50MB 0.017% 98.90% 2621.31MB 88.80% github.com/kopia/kopia/repo/content.maybeParallelExecutor.func5

I hope this helps.

I found it.

KopiaUI v0.23.1 always create new session when create a new backup.

ss -ntp
[ESTABLISHED connection to kopia server]

cat kopia-20261010-160759-119559-server-start.0.log | grep :63321

2026-10-12T06:51:13.257555Z INFO kopia/server starting session for user “blank” from 192.168.254.1:63321
2026-10-12T06:51:20.560539Z INFO kopia/server starting session for user “blank” from 192.168.254.1:63321
2026-10-12T07:45:02.204911Z INFO kopia/server starting session for user “blank” from 192.168.254.1:63321
2026-10-12T08:45:01.722747Z INFO kopia/server starting session for user “blank” from 192.168.254.1:63321
2026-10-12T09:45:01.859262Z INFO kopia/server starting session for user “blank” from 192.168.254.1:63321

After i forcefully disconnect the client, with:
ss -nt src ‘[::ffff:192.168.254.5]:51515’ dst ‘[::ffff:192.168.254.1]:63321’ -K

Than the logs show up all the session ended for user. And i get back my memory.
In 2 days, i had 700 open sessions, until i terminated them.

Old sessions never gets timeouted, or deleted until the connection closes. → Data never gets reused, but hanging in ram indefinitely.

The Windows and Linux clients affected too.