Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Memory Leaks
#1
Howdy All!

Another thing I am seeing when I stress test my web app that creates a lot of controls is that memory starts growing exponentially and doesn't seem to get released in a decent time period.

In the past there have been discussions on various ways/attempts to automatically shut down sessions before the time-out after a period of no user activity - that is, the time out value gets reset every time the types / clicks a button.

Any ideas/progress on such a method?

Thanks,

Shane
Reply
#2
Howdy Shane, isn't the TIWServerController.SessionTimeOut workign for you? The value is in minutes and it should do the workig for releasing a session that has been timed out.

Or do you wish to free a certain session on Demand?
Reply
#3
Well I dont knwo what is the timour for freeing a timed out session but maybe you can do it with your own timer and looking for timed out sessions for freeing them.

Check the demo SessionList: https://github.com/Atozed/IntraWeb/tree/...essionList

To get the TIWApplication objects, check each one if it is timed out (TIWApplication.Terminated) and free it.
Reply
#4
doesn't that miss the point of the stress test ?
i wouldn't make my system's "life" easier in tests.
Reply
#5
(08-08-2018, 07:44 PM)fduenas Wrote: Howdy Shane, isn't the TIWServerController.SessionTimeOut workign for you? The value is in minutes and it should do the workig for releasing a session that has been timed out.

Or do you wish to free a certain session on Demand?

Howdy Francisco!

I am finding that I am having memory issues with my web application if the a lot of sessions stay open over time. If I make the timeout value, low or during testing force the session closed, I can stress test my application for about an hour and make over 1000 reservations before I start getting a serious issue.

Since I am using C Builder 10.2, FastMM debug doesn't work and I haven't found a reliable memory tracking tool/library  that works for C Builder.

All the best,

Shane
Reply
#6
Hi Shane,

one possibility is setting IWForm.KeepAlive = True for your forms. This is easier accomplished when you use virtual form inheritance, so you set the base form to True and all forms are also set.

Then you can set your ServerController.SessionTimeout to a small value (depending on your case). You can start with 2 minutes, for instance, and see how it goes.

KeepAlive will periodically send an Ajax request to your server and the session won't expire, as long as there is an active form. This might have a potential drawback which is, the session might be active for extremely long periods if the user keep it the browser tab opened. 

On the other hand, when the browser tab containing the application closes it will stop sending this request and the session will expire within a shorter time (according to your SessionTimeout setting).
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)