Skip to content

fix(macos): stop polling VPNService.getStarted() every second on home screen - #1874

Open
david-build wants to merge 1 commit into
KaringX:mainfrom
david-build:fix/macos-ne-session-leak
Open

fix(macos): stop polling VPNService.getStarted() every second on home screen#1874
david-build wants to merge 1 commit into
KaringX:mainfrom
david-build:fix/macos-ne-session-leak

Conversation

@david-build

Copy link
Copy Markdown

Part of #1873.

On macOS every getStarted() call goes through loadAllFromPreferences and creates NE session objects, so the 1s urltest ticker adds constant churn on nesessionmanager. The state is already delivered to _onStateChanged, so just use the cached value.

Doesn't fix the session leak itself (that's in the vpn-service plugin, details in the issue), but removes the biggest steady source of it in the app.

…creen

On macOS every getStarted()/getState() call goes through
loadAllFromPreferences and creates NETunnelProviderSession objects that
never get released. After a couple of days of uptime the UI process ends
up with hundreds of thousands of live sessions (321904 measured with
heap), and toggling the VPN then floods nesessionmanager with session
info requests from the main thread. That is what freezes the whole
system on connect/disconnect, see KaringX#1873.

The urltest ticker already gets the state via _onStateChanged, so use
the cached value instead of asking the plugin once per second.
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