FS#57924 - gdb takes too much memory when debugging Qt in Qt Creator

Attached to Project: Arch Linux
Opened by Shawn Rutledge (ecloud) - Friday, 23 March 2018, 08:10 GMT
Last edited by Antonio Rojas (arojas) - Monday, 21 May 2018, 07:33 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Antonio Rojas (arojas)
Architecture x86_64
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

As a Qt developer and maintainer of Qt Quick (developing Qt itself, not just apps), I often need to use debug builds of Qt, trace execution, debug crashes etc. I use Qt Creator for this, and it in turn uses a gdb session. For some reason, nowadays it takes many gigabytes of RAM (e.g. 6-8GB on different occasions) to load up all the debug symbols in gdb, before the process can even start running. This does not happen when I use gdb on the command line, only the way that Creator uses it. So it may be that Creator uses some sort of gdb command which makes it behave as a memory hog. But the only people noticing this issue are Arch Linux users: so it doesn't have very high visibility within the company, and I don't know if there is some relatively recent change in Creator that may have caused it, or it's a gdb bug, or lack of optimization, or what. I have gdb 8.1 now, but have also tried downgrading to gdb 7.12.1; it didn't help. The result is that I can only use machines which have lots of memory and still have to be very careful not to run anything else while debugging Qt, because 12GB of RAM is the bare minimum to do that now, to hold gdb + Creator + X11 all at the same time; and it has to be a fresh enough Creator session that Creator hasn't yet turned into too much of a hog itself. It's hopeless on my 4GB laptop; 8GB wouldn't be enough either. I think that's excessive.

Additional info:

The general information about how to build Qt from git is here https://wiki.qt.io/Building_Qt_5_from_Git

I usually configure it something like this:

mkdir ~/dev/qt5-dbg; cd ~/dev/qt5-dbg
../qt5/configure -developer-build -debug -nomake examples -nomake tests -opensource -confirm-license -no-icu -no-tslib -no-pch
make (I use icecc and ccache, that's why -no-pch is useful)

Steps to reproduce:

- build Qt from git
- open any Qt Quick example or application in Qt Creator
- build the example with the local Qt build
- try to debug it (hit the button to run in the debugger)
- observe memory usage with top in another shell
- be prepared to kill gdb before your system crawls to a halt
This task depends upon

Closed by  Antonio Rojas (arojas)
Monday, 21 May 2018, 07:33 GMT
Reason for closing:  No response
Comment by Shawn Rutledge (ecloud) - Friday, 23 March 2018, 08:15 GMT
Upstream Creator bug (I just created): https://bugreports.qt.io/browse/QTCREATORBUG-20133
Comment by Doug Newgard (Scimmia) - Tuesday, 27 March 2018, 14:22 GMT
I was waiting to see where the upstream ticket went to know where to assign this, but they requested more info 4 days ago and have received no response. Should I just close this?
Comment by Shawn Rutledge (ecloud) - Tuesday, 27 March 2018, 19:33 GMT
Oops I missed that. Attached the log to that bug now.
Comment by Antonio Rojas (arojas) - Monday, 14 May 2018, 15:56 GMT
Any news about this? Any evidence that this has anything to do with packaging or that there's anything that can be done to mitigate it? Otherwise it doesn't make much sense to keep this open.

Loading...