WebSessions not being released


I have a web application running as a stand alone web app running on Windows. The app is being heavily used but after a few months of use, I start to see the App.SessionCount going up and up.

I have a status page that allows me to see what’s going on. (This page only runs on demand). It’s giving me this:

My App.Session count is 541 but the list shows the sessions that are not Nil (There’s about 16 on the list). My App.SessionTimeout = 5 seonds.
Under normal circumstances, the App.SessionCount matches the list.

I’m not holding any references to the session anywhere (they would have to be at the application level).
Why have I got hundreds of Nil Sessions that aren’t being released? Any clues? Any pointers?
The only way to clear this is to stop and start the application.

Here’s the code to display the list:

    For n = 0 to App.SessionCount - 1
      ThisSession = App.SessionAtIndex(n)
      If ThisSession <> Nil then

          ' Add ThisSession to the list        

      End If

What you are seeing is a bug. Please file a bug report and include everything you’ve written here.

I also suggest that you stop setting SessionTimeout. A value of 5 probably means that you’re disconnecting valid users from time to time.

Thanks Greg, I have filed a bug report - 44301

To be clear, the bug is most likely that the nil session objects are not being removed from the array. I can’t think of why this would be however.

@Greg O’Lone The problem with that though is that the memory usage then soars until the application falls over. I’m running a 24/7/365 Accident and Emergency system so the system going down (inevitably at 3am) is not good. Your prompt assistance would therefore be appreciated.



Also, I got the timescale wrong in the initial post, it takes a few weeks for this to occur, not a few months.

Well, I’ve done a little investigation this morning and I can’t get it to occur with a simple project, so we’re back to trying to figure out what’s up with your app. It’s likely that if this were a bug in the framework, everyone’s apps would be crashing due to memory problems, but they’re not.

If you can reproduce this in a smaller project, I’d encourage you to add it to the case so we can check it out.

@Greg O’Lone
Greg, My apologies, I got misleading information from site and the problem is NOT due to Nil Sessions in the list after all. Sorry for wasting your time on this.

I have requested the issue closed from Feedback.

Back to the drawing board for me!