Skip to content

[BUG] FlClashCore 100% CPU after profile switch on long-running instance #62

@Eninspace

Description

@Eninspace

Описание проблемы / Describe the bug

[Bug] FlClashCore 100% CPU after profile switch on long-running instance

Environment

• App: FlClashX 0.3.2
• OS: macOS 15.x, Apple Silicon (arm64)
• Core: mihomo (Clash.Meta) via CGO bridge
• Uptime before bug: 12–24+ hours

Description

After running FlClashX for 12–24+ hours, switching profiles causes FlClashCore (Go binary, runs as root) to spike to 100–154% CPU permanently. The Dart UI process (FlClashX) stays at ~0.1% CPU until VPN disconnect, at which point it also spikes to ~142%.

Restarting the app immediately fixes the issue.

Additional observations

• After the spike, disconnecting VPN causes FlClashX (Dart UI) to also spike to ~142% CPU
• Reconnecting drops Dart back to normal, but FlClashCore stays at ~100%
• Switching profiles again + toggling VPN off/on drops CPU back to normal 3%
• Simply toggling VPN on/off (without profile switch) does NOT reproduce
• Network interruptions (ifconfig en0 down/up) do NOT reproduce
• Fresh app restart always fixes it

Expected Behavior

Profile switch should complete with no sustained CPU increase.

Actual Behavior

FlClashCore permanently consumes 100%+ CPU after profile switch on a long-running instance. Only full app restart or profile switch + VPN toggle cycle resolves it.

Activity Monitor data

After profile switch (FlClashCore only):

• FlClashCore: 101.2% CPU, 101 threads, 1,598 idle wake-ups
• FlClashX: 0.1% CPU, 16 threads, 3 idle wake-ups

After disconnect (both spike):

• FlClashCore: 153.8% CPU, 101 threads, 43,801 idle wake-ups
• FlClashX: 141.9% CPU, 17 threads, 52 idle wake-ups

Image Image

Версия / Version

0.3.2

Как воспроизвести / To Reproduce

  1. Launch FlClashX, connect VPN with any profile
  2. Leave running for 24+ hours with active internet usage
  3. Switch to a different profile
  4. Toggle VPN off/on (works fine at this point)
  5. Switch profile again — without toggling VPN off/on after
  6. Observe FlClashCore in Activity Monitor — CPU jumps to 100%+, threads at ~101, idle wake-ups climbing rapidly

Операционная система / OS

MacOS

Логи (не прикрепляйте файл, вставьте содержимое логов напрямую) / Log (Do not upload the log file, paste the log content directly)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions