Atozed Forums
Memory Leaks - Printable Version

+- Atozed Forums (https://www.atozed.com/forums)
+-- Forum: Atozed Software Products (https://www.atozed.com/forums/forum-1.html)
+--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html)
+---- Forum: English (https://www.atozed.com/forums/forum-16.html)
+----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html)
+----- Thread: Memory Leaks (/thread-568.html)



Memory Leaks - ShaneStump - 08-08-2018

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


RE: Memory Leaks - fduenas - 08-08-2018

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?


RE: Memory Leaks - fduenas - 08-08-2018

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/master/XIV/Delphi/SessionList

To get the TIWApplication objects, check each one if it is timed out (TIWApplication.Terminated) and free it.


RE: Memory Leaks - EitanArbel - 08-08-2018

doesn't that miss the point of the stress test ?
i wouldn't make my system's "life" easier in tests.


RE: Memory Leaks - ShaneStump - 08-08-2018

(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


RE: Memory Leaks - Alexandre Machado - 08-14-2018

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).