0

Attempting to use QT creator as a C++ IDE for UE5 project on Linux. Engine built, and project generated all good. have the .pro file for QT creator. When opening it, it starts to parse the files. Takes a few minutes and then it just close… Looking into the issue seems like when QT creator starts to parse, it generates a compiled_commands.json file. When that file reach about 19GB in size a new process started by QT (ClangD), that starts to consume all available RAM (32GB). When it runs out, it crashes (Both clangd.main and QT creator). - Task killed by OOM killer (out of memory) Not sure why or how to fix.

Using Arch Linux (6.2.7-arch1-1 ), with QT Creator 9.0.2, ClangD 15.0.7 Project freshly generated by the editor no modification before opening it. (.pro project files generated after project by GenerateProjectFiles.sh -QMakefile)

Tried to reinstall clanged and qt creator - same result

Tried to build clangd from source - same result

Tried to run Qt from terminal to see if any error ( no error message, terminal also crash. If output redirected to a file, file remains empty)

Botje
  • 26,269
  • 3
  • 31
  • 41
Pain67
  • 326
  • 1
  • 9
  • 2
    a 19GB compile_commands file sounds like a lot. Does adding the `-CurrentPlatform` flag to GenerateProjectfiles.sh help a bit? – Botje Mar 31 '23 at 08:30
  • Adding -CurrentPlatform flag makes no difference, same result. – Pain67 Apr 01 '23 at 10:28

1 Answers1

0

I'm currently creating a unreal-clangd extension. I use ubt to create the compile commands file though. This cc file is for intellisense only and only contains your project's files so wont have all unreal symbols.

The solution I came up with was to create a completionHelper.cpp. It's not part of your code. Currently in completionHelper.cpp I include "Engine.h", "Runtime/Engine/Public/EngineSharedPCH.h", and "Net/UnrealNetwork.h".

I include this completionHelper in my Intellisense compile commands file.

I also have a way to add all headers from a directory to completionHelper for any plugins that I need symbols for.

Another thing I found is that I have to open completionHelper.cpp at VSCode start and let clangd process it to also include any Unreal macros into code completion.

When processing completionHelper VSCode's memory can go to ~1.5GB. After, it will settle down to ~1GB.

boocs
  • 456
  • 1
  • 3
  • 5