×

INDI Library v1.9.8 Released (29 Sep 2022)

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

KStars memory leak and crash

  • 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 months 3 weeks ago #83562
The topic has been locked.
  • Posts: 214
  • Thank you received: 39
So, now that the problem is found and fixed.... Could you put a summary about how to stop sound and notifications on Astroberry ;)
3 months 3 weeks ago #83576
The topic has been locked.
  • Posts: 19
  • Thank you received: 1
Nope, still seeing memory usage increase with notifications on or off.
Sorry folks.
I'm not sure how to run heaptrack. It's installed, but not a great linux user to do have to either ask for a how-to crash course, sorry folks.
The following user(s) said Thank You: Rafa Barberá
3 months 3 weeks ago #83582
The topic has been locked.
  • Posts: 188
  • Thank you received: 43

Replied by nou on topic KStars memory leak and crash

What kind of usage memory increase? Because increase of cache/buffers is no indication of memory leak.
3 months 3 weeks ago #83584
The topic has been locked.
  • Posts: 18
  • Thank you received: 2

Replied by MH on topic KStars memory leak and crash


This was my experience as well - I delved waaaay into the rabbit hole when I was having this problem and found the "turn notifications and sounds off" potential solution (there are a number of threads on this, with this proposed solution), and it didn't seem to matter.

I recall actively being excited like "oh nice an easy solution" and of course it couldn't be that simple haha
The following user(s) said Thank You: Rafa Barberá
Last edit: 3 months 3 weeks ago by MH. Reason: Additional thought, quotes still sad
3 months 3 weeks ago #83585
The topic has been locked.
  • Posts: 19
  • Thank you received: 1
@Nou, sorry if my terminology is incorrect. Just assumed memory leak is when memory is used up continuously, until the system has used all resources and causes things to crash. Let's not get bogged down with terminology!
As in my original post , I've had several sessions crash shortly after going to bed, and believe them to be from a lack of memory on the RPi.
I say this as I've documented the memory usage fill up, then the kstars logfile stops writing (kstars crashes) and the available memory increases and remains steady until I return to offload the imaging data several hours later.
Since really delving deeper (all the different memories, and purging the caches, etc), I've been unable to make it crash again, and as the nights are so short imaging isn't worth it just at present.
Again, I have a 'fix' that should work for me, but I'm disappointed that I've not been able to find the reason and solve the problem, but it does seem like there are others still seeing the same, perhaps without crashes...
Last edit: 3 months 3 weeks ago by Pete Simpson.
3 months 3 weeks ago #83586
The topic has been locked.
  • Posts: 18
  • Thank you received: 2

Replied by MH on topic KStars memory leak and crash

Something you may be able to do to recreate (and what I used previously) was to just take a lot of dark frames over a long period of time, especially if you need to build a darks library for specific temperatures and haven't had time yet.

Otherwise, can just take a lot of covered photos even if they aren't needed for calibration frames; the bug tended to reproduce itself when doing something like that for me.

There are also some ways you can log RAM usage over time.

Could use something like one of the answers to log RAM, CPU usage of Kstars over time to a local file and cross-reference, such as a one-liner I quickly cobbled together based on that answer:
while true; do ps -p <kstars_PID> -o %cpu,%mem,cmd; sleep 5; done | while read memStats; do echo "$(date): $memStats"; done | tee -a memtest.logs

This gives you timestamp outputs per line, which you can likely cross-reference with the Kstars logs; I strongly suspect that the memory increase will creep up after each iteration of the memory leak, or around the same time.

Edit: Actually, it looks like pmap may be better suited for this task based on this thread ; so to modify the above, it would look like:
while true; do pmap -x <kstars_PID>; sleep 5; done | while read memStats; do echo "$(date): $memStats"; done | tee -a memtest.logs
Last edit: 3 months 3 weeks ago by MH. Reason: Likely better diagnostic one-liner
3 months 3 weeks ago #83587
The topic has been locked.
  • Posts: 188
  • Thank you received: 43

Replied by nou on topic KStars memory leak and crash

Ok just tested and running heaptrack is quite easy. Just install "sudo apt install heaptrack heaptrack-gui" and then run "heaptrack kstars" after you close down kstars it will even tell you next command to analyze results. Try run one short session with few frames exposed and then longer one. Then post screenshot of summary tab so we can investigate further.
3 months 3 weeks ago #83596
The topic has been locked.
  • Posts: 210
  • Thank you received: 44

Replied by Gene N on topic KStars memory leak and crash

So I tried a varying set of sequences, total after all was 3000 images captured using SIM CCD and SIM Telescope.

Started at this
13863 root 20 0 643244 173444 76296 R 69.3 36.8 1:40.63 kstars

Yes, went -down- a lot after 300
13863 root 20 0 643724 101992 30048 R 5.3 21.7 6:04.19 kstars

( I verifed this, after all the below re-ran with pulse and web enabled)
After 300 coldstart
30821 root 20 0 642988 104668 33792 S 13.8 22.2 8:28.06 kstars
)
Intermixed in the sequences I re-enabled pulse-audio but no Notifications
Also, prior to the last 600 images I re-enabled the web services and logged into port 8080
Also had FITS viewer enabled and disabled intermittently

After 3000 images
13863 root 20 0 645872 98996 37704 R 68.3 21.0 12:50.20 kstars
The image count:
astroberry@astroberry:~ $ ls -ltr TEST/Light/*/* | wc
3000

Then after sitting idel for hours

13863 root 20 0 644536 84824 29560 S 17.4 18.0 89:44.97 kstars
The following user(s) said Thank You: Jasem Mutlaq, MH
3 months 3 weeks ago #83599
The topic has been locked.
  • Posts: 76
  • Thank you received: 5
Hi Rafa

you go into kstars, settings and select configure notifications. That lists all the different events kstars will notify about. Go through unselecting the ‘play a sound’ tick box for each entry - ones with it set have a black arrow on the left side. Set another type of notification if needed. Once done click ok and enjoy the silence (might not notice the change with an astroberry :) )

Regards

Nigel
3 months 3 weeks ago #83603
The topic has been locked.
  • Posts: 842
  • Thank you received: 81
Hi everyone
I don't think this is astroberry specific. Tested on two separate kubuntu boxes with the same result: kstars crashes leaving indi up and running.

We think the leak is in Stellar Solver; removing alignment calls to StellarSolver by using ASTAP and preventing calls to StellarSolver's Sextract from the guider by using PHD2, there is no crash (tested now for 4 sessions of 5 hours).

Conclusion and workaround: use ASTAP and PHD2, but we'd really like to be able to use the internal guider again. It would be great is this could be fixed.
Thanks for reading and any testing you need, please just shout.

Clear skies,
Steve

Reported on the forum here (also reproduces the syslog usb error each time the zwo guide camera takes a frame)
www.indilib.org/forum/ekos/11784-kstars-...id-socket-error.html

Bug report here:
bugs.kde.org/show_bug.cgi?id=454866
kubuntu 22.04
700d, eq6, 120mm. Yes, the old one.
The following user(s) said Thank You: Jasem Mutlaq
3 months 2 days ago #84045
The topic has been locked.
  • Posts: 53
  • Thank you received: 6

Replied by Outta on topic KStars memory leak and crash

Hi,

I am having issues with crashing as well, it is not sometimes, it is literally every run when I have Journal enabled. So if Journal is not scheduled it works perfectly, when I enable Journal, i get a random crash at some point in time, regardless is Journal running at the moment or just sleeping until conditions met. I even switched to Online astrometry, But it does not help, it just crashes randomly with nothing special in logs... I will try with disabling "Guide" in Journal maybe that will help,

Astroberry on Pi4B 1GB, RPICam

Also another thing I noticed since latest update, my KStars does not get updated from mount in regards to location and time. Mount is OnStep. Mind you might be issue with mount as I have to configure it on every startup, but Kstars never picks up any more. But that is not big issue, crashing is making Journal unusable.
3 months 2 days ago #84046
The topic has been locked.
Time to create page: 0.915 seconds