You are not logged in.
Hey, I have an issue with heaptrack https://bugsfiles.kde.org/attachment.cgi?id=138353 I am unsure how to resolve it, it produces empty heap allocations stats most of the time;
Yes I know I could have gave heaptrack ptrace capability before running it I guess instead of using root.
Right now I just setup a simple watchdog script to notify me if the memory usage of kwin reaches 1GiB again and stays at around 900MiB-1GiB that way for 10 minutes(which I know it stays for quiet a bit of time at 1.5GiB until restarted).
#!/usr/bin/env bash
vaa=1
mem_usage=100
KiloByte=1
MegaByte=$((1024*KiloByte))
GigaByte=$((1024*MegaByte))
M900=$((900*MegaByte))
pida=$(pidof kwin_x11)
while $var; do
mem_usage=$(pmap -x $(pidof kwin_x11) | tail -1 | awk '{print $4;}')
if [ $GigaByte -lt $mem_usage ]
then
echo -e "\a"
sleep 600
mem_usage=$(pmap -x $(pidof kwin_x11) | tail -1 | awk '{print $4;}')
if [ $M900 -lt $mem_usage]
then
echo -e "\a"
echo "Haha Yes!"
echo "Here I will paste a heaptrack command, if I knew how to make it work."
var=0
fi
fi
sleep 30
doneWhat happens when I execute heaptrack:
[kubast2@archlinux ~]$ sudo heaptrack -p $(pidof kwin_x11) -o kwin_x11.gz
[sudo] password for kubast2:
-o kwin_x11.gz
heaptrack output will be written to "/home/kubast2/heaptrack.kwin_x11.288049.zst"
injecting heaptrack into application via GDB, this might take some time...
Error while reading shared library symbols for /usr/lib/libpthread.so.0:
Cannot find user-level thread for LWP 272580: generic error
Cannot find user-level thread for LWP 288084: generic error
An error occurred while in a function called from GDB.
Evaluation of the expression containing the function
(heaptrack_inject) will be abandoned.
When the function is done executing, GDB will silently stop.
/usr/bin/heaptrack: line 269: 288068 Aborted (core dumped) gdb --batch-silent -n -iex="set auto-solib-add off" -p $pid --eval-command="sharedlibrary libc.so" --eval-command="call (void) __libc_dlopen_mode(\"$LIBHEAPTRACK_INJECT\", 0x80000000 | 0x002)" --eval-command="sharedlibrary libheaptrack_inject" --eval-command="call (void) heaptrack_inject(\"$pipe\")" --eval-command="detach"
injection finished
heaptrack stats:
allocations: 466
leaked allocations: 278
temporary allocations: 173
removing heaptrack injection via GDB, this might take some time...
Error while reading shared library symbols for /usr/lib/libpthread.so.0:
Cannot find user-level thread for LWP 288084: generic error
'heaptrack_stop' has unknown return type; cast the call to its declared return type
Heaptrack finished! Now run the following to investigate the data:
heaptrack --analyze "/home/kubast2/heaptrack.kwin_x11.288049.zst"Most of the time it is unable to get any kind of stats, so I end up with heaptrack stats of 0 everywhere.
Seems like gdb core dumps, and takes kwin_x11 with it, and I am not sure what to think about Cannot find user-level thread for LWP 272580: generic error.
:^)
Last edited by jakubby (2021-05-12 08:41:57)
Offline