Skip to content

feat(mobile): adopt radiance memory monitor, remove Go-side memory logger#8893

Merged
garmr-ulfr merged 13 commits into
mainfrom
garmr/feature/mobile-memory-monitor
Jul 6, 2026
Merged

feat(mobile): adopt radiance memory monitor, remove Go-side memory logger#8893
garmr-ulfr merged 13 commits into
mainfrom
garmr/feature/mobile-memory-monitor

Conversation

@garmr-ulfr

@garmr-ulfr garmr-ulfr commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Adopts the adaptive mobile memory monitor that now lives in radiance, and removes the redundant Go-side memory logger from the tunnel process.

  • Bumps radiance to the build that includes the vpn/memmon adaptive memory monitor (companion PR: feat(vpn): adaptive memory monitor for the mobile VPN daemon radiance#550). On iOS it reclaims proactively under jetsam pressure; on Android it runs observe-only.
  • Removes lantern-core/mobile/memory_logger.go and its startMemoryLogger() / stopMemoryLogger() calls in mobile.go. That logger sampled Go-runtime stats via runtime.ReadMemStats (stop-the-world) on a timer in the tunnel process; radiance's monitor now covers memory observation (and reclamation) from inside the same process, without the STW pause.
  • Picks up the radiance change to include the memory crash-dump file in issue reports.

Summary by CodeRabbit

  • Bug Fixes
    • Reduced background memory logging during mobile tunnel startup and shutdown for a cleaner runtime experience.
    • Removed the periodic memory-reporting process from the mobile IPC flow, helping keep mobile sessions lighter.
  • Chores
    • Updated third-party dependencies to newer versions.

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 98483d32-927e-4b07-ad7c-403761c7db4a

📥 Commits

Reviewing files that changed from the base of the PR and between 80bfc69 and 6d09e78.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (1)
  • go.mod
✅ Files skipped from review due to trivial changes (1)
  • go.mod

📝 Walkthrough

Walkthrough

Removes the mobile memory logger and its IPC lifecycle hooks, and updates go.mod to newer pseudo-versions for radiance and indirect dependencies.

Changes

Memory logger removal and dependency bump

Layer / File(s) Summary
Remove memory logger and its call sites
lantern-core/mobile/memory_logger.go, lantern-core/mobile/mobile.go
Deletes the memory logger implementation and removes its start/stop calls from StartIPCServer and CloseIPCServer.
Dependency version bump
go.mod
Updates github.com/getlantern/radiance and the indirect github.com/getlantern/common and github.com/getlantern/lantern-box requirements.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • getlantern/lantern#8883: Also modifies go.mod to bump shared Lantern networking dependencies, including github.com/getlantern/radiance.
  • getlantern/lantern#8894: Also updates github.com/getlantern/radiance to a newer pseudo-version.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: switching mobile memory handling to radiance and removing the Go-side memory logger.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch garmr/feature/mobile-memory-monitor

Comment @coderabbitai help to get the list of available commands.

@garmr-ulfr garmr-ulfr requested review from Copilot and removed request for Copilot July 2, 2026 22:31
@garmr-ulfr garmr-ulfr marked this pull request as ready for review July 2, 2026 22:57
Copilot AI review requested due to automatic review settings July 2, 2026 22:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR switches mobile tunnel-process memory monitoring/logging responsibility from Lantern’s Go-side periodic runtime.ReadMemStats sampler to Radiance’s adaptive vpn/memmon monitor by bumping the radiance dependency and removing the redundant in-process Go memory logger hooks.

Changes:

  • Remove the Go-side tunnel memory logger start/stop calls from StartIPCServer / CloseIPCServer.
  • Delete lantern-core/mobile/memory_logger.go (the Go runtime memstats ticker logger).
  • Bump github.com/getlantern/radiance to a newer pseudo-version in go.mod/go.sum.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
lantern-core/mobile/mobile.go Removes the lifecycle hooks that started/stopped the Go-side memory logger in the tunnel IPC server.
lantern-core/mobile/memory_logger.go Deletes the periodic Go runtime memstats logger implementation.
go.mod Updates the github.com/getlantern/radiance dependency version.
go.sum Updates checksums for the new github.com/getlantern/radiance version.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@atavism

atavism commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

@garmr-ulfr This one looks good to me too. Do you mind fixing the merge conflicts?

@jigar-f

jigar-f commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

@garmr-ulfr, it has been tested on iOS, I did not get time to test this in Android, but I think we should test this in Android before merging it in.

@garmr-ulfr

Copy link
Copy Markdown
Contributor Author

@garmr-ulfr This one looks good to me too. Do you mind fixing the merge conflicts?

@atavism, yeah, I can do that. This is still waiting for the companion PR in radiance to be merged.

For future PRs that have a radiance companion, should I keep them as drafts until the companion PR has been merged?

@garmr-ulfr garmr-ulfr merged commit f954364 into main Jul 6, 2026
10 checks passed
@garmr-ulfr garmr-ulfr deleted the garmr/feature/mobile-memory-monitor branch July 6, 2026 19:08
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.

4 participants