NetTalk Central

Author Topic: using in-memory driver  (Read 3195 times)

cwtart

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • CommPay Software
    • Email
using in-memory driver
« on: July 27, 2013, 07:24:50 AM »
Clarion 8 9661 NT 7.15

My Clarion Win32 app creates many reports that consists of a queue that is populated with data taken from many different tables. To do the same thing in my NetWebServer app for each report I create a randomly named temporary .tps file that is unique for each session. All of these temp files are created in a temp folder under the web folder. The temp folder contents are deleted each night via a timer in the web app .exe procedure. This essentially gives me the same functionality in the web app as using a queue for reports in the Win32 app.

This works fine but because each report must be created on the fly when the NetWebBrowse is displayed it may take some time for some of the reports to generate.

I am thinking of using the in-memory driver for these temporary tables rather than an actual on-disk file. There would still be the time involved in reading the disk tables to create the memory table but the read time to create the browse would be eliminated.

My concern is the use of RAM - there may be 25 different users logged in at any one time with each user having 10-15 memory tables created for their session. How do I remove the memory tables from RAM when each session ends? And how do I know when a session ends? What is/are the best ways to manage the RAM in this scenario?

Thanks,

Chuck

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: using in-memory driver
« Reply #1 on: July 28, 2013, 03:22:43 AM »
Hi Chuck,

why did you move away from Q's? They are only a problem at a global level not procedural level.

Cheers,

Kevin

cwtart

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • CommPay Software
    • Email
Re: using in-memory driver
« Reply #2 on: July 28, 2013, 06:03:02 AM »
Kevin,

I may have a misunderstanding here - how would you use a queue for a browse? Is it not necessary to select a table for a browse?

Chuck

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: using in-memory driver
« Reply #3 on: July 28, 2013, 10:59:25 PM »
Hi Chuck,

I believe Kevin is asking about Queues in reports - your original post seemed to imply this was in report procedures.
For browses you cannot use queues, but for reports you can.

>> My concern is the use of RAM - there may be 25 different users logged in at any one time with each user having 10-15 memory tables created for their session. How do I remove the memory tables from RAM when each session ends?

you would want to delete all the records from the memory table that belong to a session, when the session ends.

>> And how do I know when a session ends?

the NotifyDeleteSession method in the webHandler will be called - you can access self.sessionid in here, but you can't access SessionValues or any other session related data. In your case you have the session id, and that's all you need to clean up your ancillary files.

>> What is/are the best ways to manage the RAM in this scenario?

Obviously the memory table approach may be faster, but will indeed use more memory. you will need to observe, and test, to see if memory use is becoming a problem in your application. It's impossible to predict if it will or won't be - that will depend on many other factors in your app.

If performance is acceptable using TPS then I'd probably carry on using that to improve scalability.

cheers
Bruce