×

INDI Library v1.9.6 Released (21 May 2022)

Bi-monthly INDI Library released with new drivers and bug fixes.

KStars memory leak and crash

  • Posts: 9
  • Thank you received: 0

Replied by Ian on topic KStars memory leak and crash

Good idea. I've tested by
sudo systemctl stop astropanel.service indiwebmanager.service indi-mqtt.service
and verifying the processes stopped. Unfortunately, still seeing a leak.

Additionally, I built KStars and libindi from master on my x86_64 desktop and attempted to reproduce the memory leak without luck. Also built the 3.5.5 KStars and 1.9.2 libindi tags (versions astroberry is using), no dice.

Simple repro on astroberry:
1. backup and then rm -r ~/.local/share/kstars ~/.indi ~/.config/kstarsrc for a fresh start
2. launch KStars
3. launch Ekos
4. wizard local devices -> create profile -> add simulator telescope and CCD
5. start Ekos
6. go to guider tab -> loop
7. Check RES memory usage via htop, check again every few minutes and notice a steady increase

It doesn't appear to matter which tab it's left on. I've tested switching to the Scheduler tab in case it was due to images/charts updating but it still leaks.
--
Raspberry Pi 4b + Astroberry
Sky-Watcher EQ6-R Pro
AstroTech AT60ED
ZWO 30mm f/4 + ASI120MM-S
Olympus O-MD E-M1 Mark II
6 months 4 weeks ago #78448

Please Log in or Create an account to join the conversation.

  • Posts: 18
  • Thank you received: 2

Replied by MH on topic KStars memory leak and crash

I've seen the same behavior time and time again with my Pi4, was wondering if it was just me or something else was going on...

I haven't yet been able to get it to actually crash outright, but still notice the steady RAM utilization increases overnight; usually by morning the system is using 80%+ of available RAM, and the syslog output just has a ton of messages in the format of:
astroberry python3[1109]: swig/python detected a memory leak of type 'INDI::BaseDevice::Properties *', no destructor found.
4 months 1 day ago #81135

Please Log in or Create an account to join the conversation.

  • Posts: 18
  • Thank you received: 2

Replied by MH on topic KStars memory leak and crash

I've seen the same behavior time and time again with my Pi4, was wondering if it was just me or something else was going on...

I haven't yet been able to get it to actually crash outright, but still notice the steady RAM utilization increases overnight; usually by morning the system is using 80%+ of available RAM, and the syslog output just has a ton of messages in the format of:

<code>swig/python detected a memory leak of type 'INDI BaseDevice Properties *', no destructor found</code>

(had to change the actual formatting of the syslog message so it would actually post; that's not the exact format but is the exact verbiage)
4 months 1 day ago #81138

Please Log in or Create an account to join the conversation.

  • Posts: 18
  • Thank you received: 2

Replied by MH on topic KStars memory leak and crash

I've seen the same behavior time and time again with my Pi4, was wondering if it was just me or something else was going on...

I haven't yet been able to get it to actually crash outright, but still notice the steady RAM utilization increases overnight; usually by morning the system is using 80%+ of available RAM, and the syslog output just has a ton of messages in the format of:
swig/python detected a memory leak of type 'INDI BaseDevice Properties *', no destructor found

(had to change the actual formatting of the syslog message so it would actually post; that's not the exact format but is the exact verbiage)
4 months 1 day ago #81139

Please Log in or Create an account to join the conversation.

  • Posts: 20
  • Thank you received: 0
Hi folks,

I have got the same problem the swig/python detected a memory leak:

astroberry python3[2015]: swig/python detected a memory leak of type 'INDI::BaseDevice::Properties *', no destructor found.

Do you have some solutions for that? I have got many craash session when I use the Scheduler.

Please I need your help.

Thank you so much and best regards. Germán.
1 month 4 days ago #83322

Please Log in or Create an account to join the conversation.

  • Posts: 19
  • Thank you received: 1
German,
Not sure if you've got anywhere with this - I'd seen the same thing with memory increasing and eventually KStars crashes mid-imaging. In summary, RPi 4 4GB, + astroberry, Canon DSLR, AZEQ6 & ZWO 120mm guidecam.
Tracked things down, by several simulation tests, wrote shell scripts to output memory usage and noted the cache seems to fill up, and eventually starts using Swap memory.
By updating the script to watch out for the cache and available memory, and if it gets too full, then things get purged automatically.
Memory usage keeps rising, but the script keeps purging, so I'm hoping I have found a workaround rather than solution.
My post here shows my extensive tests, and scripts also so you could try and see if you got same result/success?
Post back so we can see!
3 weeks 5 days ago #83470

Please Log in or Create an account to join the conversation.

I've used Heaptrack before to check if we are getting any memory leaks, but I couldn't find anything substantial. Valgrind doesn't work at all with KStars, so we can't use that to figure out any memory leaks. Peter, you think you can use Heaptrack or another tool to help us pin this issue down?
Jasem Mutlaq
Support INDI & Ekos; Get StellarMate Astrophotography Gadget.
How to Submit Logs when you have problems?
Add your observatory info
3 weeks 5 days ago #83480

Please Log in or Create an account to join the conversation.

  • Posts: 66
  • Thank you received: 5
I am trying to use the sanitizers on kstars to see what gets thrown out. Threw out a number of complaints but not yet sure whether they are actual leaks or not. Still investigating.
3 weeks 5 days ago #83487

Please Log in or Create an account to join the conversation.

  • Posts: 200
  • Thank you received: 40

Replied by Gene N on topic KStars memory leak and crash

For whatever it is worth, on a build from source not on an Astoberry distribution (last version I loaded) Kstars 3.5.7, Ian's method to show issue
Quote
"1. backup and then rm -r ~/.local/share/kstars ~/.indi ~/.config/kstarsrc for a fresh start
2. launch KStars
3. launch Ekos
4. wizard local devices -> create profile -> add simulator telescope and CCD
5. start Ekos
6. go to guider tab -> loop
7. Check RES memory usage via htop, check again every few minutes and notice a steady increase
"

I see no issues whatsoever after running for hours. I tried changing the main sim ccd resolution and using that as the guide capture also and still no growth.

This is on Pi with - 1gig- memory and buster
Linux pi-4-1 5.10.63-v7l+
3 weeks 4 days ago #83513

Please Log in or Create an account to join the conversation.

  • Posts: 200
  • Thank you received: 40

Replied by Gene N on topic KStars memory leak and crash

Disable all Pulseaudio and notifications?
I ran the same on an Astroberry with Kstars 3.5.5 and it gobbled up memory.

Disabled the service as above, still growing
Stopped NGIX service and still growing.

Disabled pulsaudio and all Notifications and -STOPPED- growing.

After an hour:

====================================
top - 12:35:52 up 2:01, 3 users, load average: 0.51, 0.41, 0.54
Tasks: 198 total, 3 running, 195 sleeping, 0 stopped, 0 zombie
%Cpu(s): 9.3 us, 4.4 sy, 0.0 ni, 85.3 id, 0.1 wa, 0.0 hi, 0.9 si, 0.0 st
MiB Mem : 459.7 total, 49.0 free, 213.4 used, 197.3 buff/cache
MiB Swap: 512.0 total, 277.2 free, 234.8 used. 181.3 avail Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
27888 root 20 0 638280 184280 90568 R 34.7 39.1 0:55.56 kstars
27947 root 20 0 70380 12016 8544 R 6.9 2.6 0:01.98 indi_simu+
27614 root 20 0 0 0 0 I 5.3 0.0 0:06.31 kworker/u+
570 root 20 0 229664 33880 17792 S 4.3 7.2 4:12.68 Xorg

top - 13:40:28 up 3:06, 3 users, load average: 0.71, 0.63, 0.64
Tasks: 195 total, 1 running, 194 sleeping, 0 stopped, 0 zombie
%Cpu(s): 8.5 us, 3.3 sy, 0.0 ni, 88.1 id, 0.0 wa, 0.0 hi, 0.1 si, 0.0 st
MiB Mem : 459.7 total, 38.6 free, 211.2 used, 209.9 buff/cache
MiB Swap: 512.0 total, 280.2 free, 231.8 used. 179.2 avail Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
27888 root 20 0 638280 184296 90568 S 34.7 39.2 18:46.90 kstars
27947 root 20 0 70380 12128 8608 S 8.3 2.6 4:48.05 indi_simu+

With Pulseaudio/Notifications running:
top - 11:16:12 up 41 min, 3 users, load average: 1.78, 1.30, 0.86
Tasks: 204 total, 3 running, 201 sleeping, 0 stopped, 0 zombie
%Cpu(s): 12.4 us, 6.6 sy, 0.0 ni, 80.2 id, 0.0 wa, 0.0 hi, 0.8 si, 0.0 st
MiB Mem : 459.7 total, 42.7 free, 249.7 used, 167.3 buff/cache
MiB Swap: 512.0 total, 317.0 free, 195.0 used. 132.6 avail Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1929 root 20 0 766644 171056 59476 S 34.1 36.3 5:14.50 kstars
1985 root 20 0 70248 11584 8196 S 9.3 2.5 1:02.27 indi_simu+

astroberry@astroberry:~ $ top
top - 12:13:20 up 1:38, 3 users, load average: 0.29, 0.53, 0.71
Tasks: 198 total, 2 running, 196 sleeping, 0 stopped, 0 zombie
%Cpu(s): 8.6 us, 4.1 sy, 0.0 ni, 87.1 id, 0.0 wa, 0.0 hi, 0.3 si, 0.0 st
MiB Mem : 459.7 total, 31.4 free, 294.2 used, 134.1 buff/cache
MiB Swap: 512.0 total, 296.0 free, 216.0 used. 90.5 avail Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1929 root 20 0 923868 216068 43748 S 31.1 45.9 24:20.27 kstars
1985 root 20 0 70248 7532 4844 S 7.9 1.6 5:15.49 indi_simu
3 weeks 3 days ago #83542

Please Log in or Create an account to join the conversation.

This is actually a known issue and you can see in various places that notifications on non-KDE systems should be disabled due to some memory leak. I filed a bug report a couple of years ago with KDE (it's an old issue) but I don't think it was ever resolved.
Jasem Mutlaq
Support INDI & Ekos; Get StellarMate Astrophotography Gadget.
How to Submit Logs when you have problems?
Add your observatory info
3 weeks 3 days ago #83554

Please Log in or Create an account to join the conversation.

  • Posts: 19
  • Thank you received: 1
Ooooo!
So in my alternative post, Nou had commented about a message I'd seen in the log file (and dismissed!) about a phonon error or warning . I'd seen it in the SGL post and as mentioned, ignored it for now.
Seeing Nou's comment, I'd disabled the SOUNDS only but instead wrote warnings to a text file so I'd be able to see warnings or track them back.
Just started another simulation with ALL notifications OFF, and also disabled the "low resources" mode - it looks like my memory usage is more stable, although that's only after a short period. I'll leave it running and come back with another report later.
There was also another update released recently for lots of Indi updates, so if the issue is fixed, it could have been either - I'll test again later with notifications back on and see what happens.
3 weeks 2 days ago #83562

Please Log in or Create an account to join the conversation.

Time to create page: 0.882 seconds