Skip to content

lldb-mi becomes unresponsive, uses lots of memory #1899

Closed

Description

@ftrofin

OS: macOS Sierra (10.12.6)
Visual Studio Code Version 1.22.2
ms-vscode.cpptools 0.16.1

Sometimes, when debugging, VS Code UI becomes unresponsive after clicking "Continue" when stopped at a breakpoint. No matter how long I wait, it doesn't recover. Attached is a sample of lldb-mi process which was at 46GB of used memory and climbing. I waited about 20 minutes in this particular case.

Please let me know if you need more information.

Thanks!
F.
Sample of lldb-mi while debugging - using 45GB of memory.txt

Activity

  1. ftrofin commented on Apr 28, 2018

    @ftrofin
    Author

    Here is another sample taken in another debugging session. In the debug console it printed "
    ERROR: LLDB exited unexpectedly with exit code 137 (0x89). Debugging will now abort." before aborting debugging. This sample was taken when lldb-mi was consuming about 27GB of memory, it crashed when it reached 46.
    Sample of lldb-mi while debugging - using 30GB of memory.txt

  2. ftrofin commented on May 1, 2018

    @ftrofin
    Author

    Here are two more samples of lldb-mi. In this case the debugger is unresponsive (like before) but it's not consuming memory like in the above case (Activity Monitor reports a stable usage of about 4 GB of memory). The lldb-mi process is using one of the cores at 100%. Both samples are taken on the same process at a minute difference. The scenario was the same as above: stopped at breakpoints, continued a few times then it stopped responding after clicking "Continue".

    Sample of lldb-mi - unresponsive while debugging-2.txt
    Sample of lldb-mi - unresponsive while debugging.txt

  3. WardenGnaw commented on May 2, 2018

    @WardenGnaw
    Member

    Thank you for all the samples. This will help with the investigation.

    Can you also provide the logs from engineLogging? It would be helpful to see what command it is failing on.

    Since VS Code UI seems to freeze, the best way to capture the logs is by adding --engineLogging=<filePath> to .vscode/extension/ms--vscode.cpptools-<version>/out/src/Debugger/extension.js. In there you should find a line that looks like:

    args: ['--interpreter=vscode']
    

    modify it to say

    args: ['--interpreter=vscode', '--engineLogging=<filePath>']
    

    Replace <filePath> with wherever you would like the logs to be saved.

  4. ftrofin commented on May 2, 2018

    @ftrofin
    Author

    Hi Andrew. I don't know which .vscode folder you're referring to. There is one in my workspace but it only contains the launch, settings and tasks.json.

    Also, to clarify, the UI is not frozen, I can click on the debugging toolbar (step over, continue, etc) and they look enabled but they don't do anything. I also experienced one or two cases where it recovered after a very long time (20+ minutes) and I was able to continue stepping. Maybe some operation is blocking the main thread during this time (hopefully the logs above are useful).

  5. WardenGnaw commented on May 2, 2018

    @WardenGnaw
    Member

    Ah sorry. The .vscode folder in home path. For OSX it should be ~/.vscode.

    If its possible to interact with the debug console. Can you can add the following to your launch.json configuration and provide a copy of the output?

    "logging": {
       "engineLogging": true
    }
    
  6. sheldonneuberger commented on May 22, 2018

    @sheldonneuberger

    I'm having this same issue. I tried adding the --engineLogging flag but it doesn't create the specified file. It looks like that codepath only runs on windows, but we're on macos.

    I left the debugger running in the frozen state, and the next day (after closing/suspending my laptop several times), I noticed it successfully stepped into the line of code! Output from engineLogging: https://gist.github.com/sheldonneuberger/f774677efb87b79cfbed75d9be0c9aba

    I've run lldb from the command line against this executable and I don't hit these issues, so it's something with vscode. This consistently repros for me, but not for one of my colleagues with a similar setup. I'll dig a bit to see if there's an obvious difference on our machines.

    My lldb -v output is:

    lldb-900.0.64
      Swift-4.0
    
  7. cedriclmenard commented on Sep 11, 2018

    @cedriclmenard

    I'm experiencing the same issue. Only when I build for Debug, not in Release (using CMakeTools).

  8. Samx2015 commented on Jun 27, 2020

    @Samx2015

    This issue still exists as of 6/27/2020. VSCode on mac: lldb-mi uses 160GB of memory.

  9. spott commented on Jul 17, 2020

    @spott

    I am also seeing this issue.

    Let me know if there is anything that I can collect in order to help work this out.

  10. DEAGS3000 commented on Jul 19, 2020

    @DEAGS3000

    Me too. VSCode on mac os 10.14.5, with lldb-mi in cpp-tools extension. this will only happen when I'm trying to do step over in a certain member function.

  11. blanerhoads commented on Jul 29, 2020

    @blanerhoads

    Me three

  12. lincoln310 commented on Sep 1, 2020

    @lincoln310

    me five.

  13. WardenGnaw commented on Sep 1, 2020

    @WardenGnaw
    Member

    The VSCode C++ Extension does not directly work on lldb or lldb-mi. We use and build lldb-mi from the lldb-mi repository and publish it.

    We build the debug adapter MIEngine to communicate with lldb-mi, but that will be in the OpenDebugAD7 process.

    If memory usage is high for the lldb-mi process, this is directly related to LLDB itself which you can report bugs to https://bugs.llvm.org/

    You can capture and send trace files to help them investigate performance issues. Here is a tutorial on how to capture a trace file but for cpptools and cpptools-srv. You will want to capture the trace on lldb-mi.

  14. 10 remaining items

  15. xsaschako commented on May 12, 2023

    @xsaschako

    This issue persists for me and i encounter it quite often.

  16. wxquare commented on May 31, 2023

    @wxquare

    Is there any ways to fix it?

  17. wibbeler commented on Jul 30, 2023

    @wibbeler

    I've seen VSCode create multiple lldb and lldb-mi processes without cleaning them up. Often, they are left unresponsive and take a lot of memory. I think this is happening when trying to inspect large stl containers (eg a list with many items). Closing VSCode did not stop the lldb* processes. I had to kill them in the Activity Monitor.

  18. arunmudhaliar commented on Oct 28, 2023

    @arunmudhaliar

    It's a mess... taking 22GB. it keeps on increasing.... and my machine starts to shy away...

  19. piaopiaoquan commented on Jan 12, 2024

    @piaopiaoquan

    i am using vs code in mac, the lldb-mi is like dead frequently when debugging , and the memory it taked increaing

  20. lucianthorr commented on Jul 19, 2024

    @lucianthorr

    Still an issue here. VSCode with the CMake Tools extension. I have two lldb-mi processes running, each taking ~20GB of memory somehow.

  21. samuelbodin commented on Nov 1, 2024

    @samuelbodin

    Has there been a more recent fix for this yet? Im running into the same issue... each debug instance I start just keeps expanding in memory until crash.

  22. shubrahgupta commented on Nov 23, 2024

    @shubrahgupta

    Hi, this is still an issue. It kept eating up the memory until I received warning to kill one of the processes. Checking in the Activity monitor, there were 2 processes of lldb active, which I had to force stop.

  23. git-flyer commented on Dec 2, 2024

    @git-flyer

    This issue still exists 2022/4/4这个问题2022/4/4仍然存在 microsoft/vscode#146655 (comment)

    And 2024/12/02 too. Using command-line debugging can temporarily avoid this problem.

  24. Wangguoliyes commented on Dec 3, 2024

    @Wangguoliyes

    who make the fxxking problem!

  25. lanl2vz commented on Dec 5, 2024

    @lanl2vz

    Me Seven I guess?

  26. fhkong commented on May 8, 2025

    @fhkong

    I met the fxxking same problem! It eats my 46GiB memory.

  27. tanish35 commented on May 17, 2025

    @tanish35

    met with the same problem my entire system ran out of memory

  28. timothy020 commented on May 29, 2025

    @timothy020

    the problem still exists. it eats 50GB momory

  29. Carlos-EAC commented on Sep 4, 2025

    @Carlos-EAC

    This just happened to me, two lldb-mi processes taking up 35 GB of memory (dwarfing Chrome's 1 GB, .2 GB after restarting it). They didn't close when I closed VSCode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions