Web app may be disconnecting users. Memory leaks?

Web app hosted on Xojo Cloud. Running 2024 R1

I had some users report the web app going unresponsive for a short period and then sometimes disconnecting them, returning them back to the login page. When I play around with the built app, I don’t experience any such issues. Then again, I am not using the app as extensively as my users. The one user I was able to get additional information from, she said she noticed this on public WiFi as well as her home network. She also said it is not all the time and not specific to any area in the app. Sometimes it reconnects for her automatically where she can continue working where she was. Other times, it disconnects her and returns her to the login page

I am still a bit new to web apps (started a little over a year ago) and am still learning best practices. I checked the statistics window, but I don’t really know how to interpret this:

  • CPU: 0%
  • Memory: 76%
  • Network: 0 bytes but when hovering over the graph, I see a max of 829 kb
  • Disk: 17%

Is that memory too high? I checked the statistics last week, and I think it was in the 70s too. Of note, the above stats are for my XC server of which there are several web apps. My dropdown for Application is disabled, so I cannot see the specific stats for a specific app

If there are leaks, what is the best way to find and fix them? I don’t use global module properties. All properties are either session-based or page-based. Do I need to nil out any of the properties after they’ve been used?

I read one of the recent Xojo blogs about memory handling and recall seeing a mention of if you have an array you need to loop through, it’s best to store the LastIndex integer as a local property so you are not calling to the array’s count each time in the loop. I’m not doing anything like this yet as I wanted to check here to see if something like that is a worthwhile change I need to make

Going back to the user I email chatted with, one of the times she got disconnected was when she was reading a content article on one of the pages. This article is loaded from a db table initially, but while the article is loaded, there are no backend processes running other than a WebTimer keeping track of the user’s time spent reading, which makes me wonder about properties or other things that are still live and not destroyed. Or maybe it is the timer…

Hi Ryan - 76% memory is getting up there. I will take a look and get back to you on that.

Thanks Jason. It would probably be helpful for me to see the app-specific stats as well. Do you know why my dropdown would be disabled in the stats window?

That’s a bug in the stats window. I sent you an email about what I think we can try doing.

Just an update on this. Jason and I have been emailing back and forth. He suggested deleting some of the test apps I had on my server and then restarting the server. I have not yet restarted as this is something I need to do in the morning so as few users will get kicked off. But just deleting the test apps, I was able to bring down the server’s memory from 76% to 63%, and Jason said it might come down further after the restart

Will report back the findings after the morning’s server restart and see if this helps with the issue

1 Like

:crossed_fingers:
Yes please let us know

Not sure if coincidence, but we had a peak of network problems today tied to DNS, beyond our powers. Nationwide, and users affected make extensive use of the 1.1.1.1 DNS, CDN seemed unstable too. At this moment everything is stable. No, nothing Xojo related here. Around 12:00 and 14:00 BRT (GMT-03:00)

I just couldn’t wait till morning :smiley:

Here are the memory usage details:

  • This morning when I originally posted: 76%
  • After deleting unneeded test apps: 63%
  • After restarting the server: 23% :open_mouth:

I am going to keep the stats window open to monitor this once users start logging back into the app. Will also reach out to the one user who was having issues to let me know if the disconnects are still occurring and as often. Then will revisit making improvements to the app itself if needed at this point

Big thanks to Jason for the easy suggestion on deleting/restarting

2 Likes