Debugger takes very long to start in a linux environment

Hi,
I have a very strange behaviour of the dart debugger. It takes around 5 minutes to start when trying to debug my tests.

Environment:

  • Kubuntu 25.04
  • flutter latest
  • Visual Studio Code latest

The problem happens when:

  • Using F5 in Visual Studio Code
  • Using “dart test --pause-after-load” in VSC-Internal-Terminal

The problem does not happen when:

  • Using Ctrl+F5 in VSC
  • Using “normal system terminal” and “dart test --pause-after-load”
  • Using a “fresh project” from “flutter create”

While the problem persists a task …/flutter/bin/cache/dart-sdk/bin/dart --enable-vm-service… is at 100% CPU for the whole 5 minutes.

When the problem starts, the output is stuck at a message “loading tests”.

I have no idea, why my application behaves that strange – only in VSC, but not in “normal system bash”.

I really would appreciate a hint, what I could do.

Thanks and Best Regards,
Tobias

Check if you are hitting this issue: dart debug session slow to start. · Issue #60252 · dart-lang/sdk · GitHub - look at ulimit output to verify.

It is fixed in the upcoming stable IIRC.

Hi,
thanks for you hint. did the following:

  1. Installed a fresh debian in a VM and added Visual Studio Code
  2. Verified, that the problem with the debugger does not occur on Debian
  3. Took the output of “uname -a” from the VSC-Terminal in Debian and also in Kubuntu

When comparing the both outputs from uname -a, the values on kubuntu are at least the same as on Debian, but some are greater. There is not value smaller.

On Kubuntu, where I have the problems, I find:
open files (-n) 1073741816

On Debian only 1048576. Is the “Kubuntu” size too big?

Best Regards,
Tobias

On Kubuntu, where I have the problems, I find:
open files (-n) 1073741816

Yep, that’s what is triggering the issue. You need to lower it or wait for the fix to be released with the next stable.

Perfect! Thanks and Best Regards!