Welcome! Log In Create A New Profile

Advanced

WebDev 28 Session Memory Usage

Posted by MediOffice 
WebDev 28 Session Memory Usage
October 09, 2023 05:36PM
I have known for a long time that the longer a user is logged in to my webdev site and the more pages they open and close the more memory the session uses on the server. I have lots of places where I call PageDisplay e.g. on menus and buttons to open other pages. I also load arrays with data which I use to populate loopers on pages. My back button is diabled - all navigation is done via the application i.e. PageDisplays.

I have done lots of controlled tests with two strategies:

a) After every PageDisplay I execute a ContextClose("") - in controlled tests of about 8 different page loads (with large numbers of records in loopers) I am reducing the memory usage by about 37%

b) Before every PageDisplay I execute arraydeletealls of the main looper arrays - in the same controlled tests of about 8 different page loads (with large numbers of records in loopers) I am reducing the memory usage by about 30%

If I do both a and b above then I get a saving of about 40% in memory on the session.

However if I stay logged in and repeat the steps over and over again the memory climbs steadily.

Anyone got any suggestions? What could I do differently? Is there a best practice?
pao
Re: WebDev 28 Session Memory Usage
October 10, 2023 04:52PM
I don't know if it helps but try using PAGEUSE instead of PAGEDISPLAY when possible.

Regards

Paulo Oliveira
Re: WebDev 28 Session Memory Usage
October 11, 2023 09:09AM
Thanks Pao, when I was looking at this issue about a year ago (or more) I tried this. Mostly it worked but often enough I would get crashes that I had to abandon it. Maybe I'll try again if my current "fixes" don't work.
Re: WebDev 28 Session Memory Usage
October 18, 2023 07:32AM
Update on this!


I finally have this working - I have very good savings on memory consumed by the sessions using a combination of deleting class arrays on calling the next page and also doing a ContextClose of previous sessions on page opens. It's taken a LOT of fiddling. It's working well in live in one of my smaller applications. Later this week I'll put it live on my large application where I often have more than a hundred concurrent connections and sessions consuming more than 200mb each! Once I know it's working well I will write it up and pass it on.
Re: WebDev 28 Session Memory Usage
November 01, 2023 09:55PM
Use awb.
Re: WebDev 28 Session Memory Usage
November 03, 2023 09:30PM
the whole purpose of dynamic webdev is sessions

if you ==>ContextClose you loos this. Better use awb and pass params from page to page ands use these to build a context yourself
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: