Skip to content

OOM hardening and memory tuning#25

Merged
attermann merged 2 commits intomasterfrom
oom_fix
Feb 27, 2026
Merged

OOM hardening and memory tuning#25
attermann merged 2 commits intomasterfrom
oom_fix

Conversation

@attermann
Copy link
Owner

  • Transport::inbound(): pre-emptive cull before destination-table insert;
    try/catch around insert for explicit OOM diagnostics
  • Transport::jobs(): split stale-entry culling into 5 independent
    per-phase try/catch blocks so a failure in one phase doesn't abort
    the others; reserve() before push_back loops in each phase
  • cull_path_table()/cull_known_destinations(): std::min_element fallback
    when sort-index allocation fails, breaking the cull-OOM-still-full loop
  • Identity::remember(): wrapped _known_destinations.insert in try/catch
    for explicit OOM diagnostic logging
  • Destination::announce(): outer try/catch covers all OOM-prone ops
    (Bytes concat, sign, Packet ctor, send); inner _path_responses.insert
    catch preserved for degraded-mode behavior
  • Packet::unpack(): dedicated std::bad_alloc catch returns false cleanly
  • Type.h: MAX_RECEIPTS and MAX_QUEUED_ANNOUNCES now overridable at
    compile time via RNS_RECEIPTS_MAX / RNS_QUEUED_ANNOUNCES_MAX
  • Transport.h: hashlist_maxsize and max_pr_tags exposed as runtime
    accessors for dynamic capacity tuning
  • Added more defines for setting storage and persistence limits (RNS_RATE_TIMESTAMPS_MAX, RNS_RANDOM_BLOBS_PERSIST_MAX, RNS_RANDOM_BLOBS_MAX)

- Transport::inbound(): pre-emptive cull before destination-table insert;
  try/catch around insert for explicit OOM diagnostics
- Transport::jobs(): split stale-entry culling into 5 independent
  per-phase try/catch blocks so a failure in one phase doesn't abort
  the others; reserve() before push_back loops in each phase
- cull_path_table()/cull_known_destinations(): std::min_element fallback
  when sort-index allocation fails, breaking the cull-OOM-still-full loop
- Identity::remember(): wrapped _known_destinations.insert in try/catch
  for explicit OOM diagnostic logging
- Destination::announce(): outer try/catch covers all OOM-prone ops
  (Bytes concat, sign, Packet ctor, send); inner _path_responses.insert
  catch preserved for degraded-mode behavior
- Packet::unpack(): dedicated std::bad_alloc catch returns false cleanly
- Type.h: MAX_RECEIPTS and MAX_QUEUED_ANNOUNCES now overridable at
  compile time via RNS_RECEIPTS_MAX / RNS_QUEUED_ANNOUNCES_MAX
- Transport.h: hashlist_maxsize and max_pr_tags exposed as runtime
  accessors for dynamic capacity tuning
Added more defines for setting storage and persistence limits:
- RNS_RATE_TIMESTAMPS_MAX
- RNS_RANDOM_BLOBS_PERSIST_MAX
- RNS_RANDOM_BLOBS_MAX
@attermann attermann merged commit c40adfb into master Feb 27, 2026
4 checks passed
@attermann attermann deleted the oom_fix branch February 27, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant