Skip to content

cjdroute core accumulates multiple GB of anonymous swap while RSS stays tiny #223

Description

@deyw-bit

Hi,

I observed the same behavior on two independent Linux VPS nodes running cjdns via cjdns.sh.

Environment

cjdns version on both hosts:

Cjdns version: cjdns-v22.1-8-g436d9a97
Cjdns protocol version: 22

Both services are launched through cjdns-sh.service:

ExecStart=/usr/local/bin/cjdns.sh exec
Restart=always

Symptom

After long uptime, the cjdroute core process accumulated several GB of anonymous memory in swap while RSS stayed very small.

Host 1

Service uptime: about 3 months.

Before restart:

cjdroute core VmSize: 7004208 kB
cjdroute core VmRSS: 8632 kB
cjdroute core VmSwap: 6813192 kB
systemd MemorySwapCurrent: ~6.5 GiB

smaps_rollup:

Rss: 8876 kB
Pss: 8872 kB
Anonymous: 7044 kB
Swap: 6813080 kB
SwapPss: 6813080 kB

After systemctl restart cjdns-sh.service:

cjdns-sh.service MemorySwapCurrent: 0
total system swap used dropped from ~10 GiB to ~4 GiB

Host 2

Service uptime: about 1 month 18 days.

Before restart:

cjdroute core VmSize: 3326580 kB
cjdroute core VmRSS: 8080 kB
cjdroute core VmSwap: 3187632 kB
system swap used: ~4.2 GiB

smaps_rollup:

Rss: ~8448 kB
Anonymous: ~6636 kB
Swap: ~3187600 kB
SwapPss: ~3187600 kB

After systemctl restart cjdns-sh.service:

system swap used dropped from ~4.2 GiB to ~1.1 GiB
cjdroute disappeared from top swap users

Notes

The swapped memory appears to be anonymous private memory, not file cache.

The process was still functioning, but this stale swap pressure contributed to low swap headroom on one host. I added a weekly restart timer as a workaround.

Question: is this expected behavior for cjdroute/cjdns, or does it look like a leak / allocator behavior that should be investigated?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions