Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Size of a VFP automation server
Message
De
03/05/1999 17:34:47
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Size of a VFP automation server
Divers
Thread ID:
00214762
Message ID:
00214762
Vues:
84
This is about controlling the size of the process of an automation server instantiated from the web. The question is at the end of this message, but first here is a description of the environment I am working with:

Myapp.exe, which is compiled in VFP6, contains 15 public classes that are accessed via foxisapi.dll from an internet browser.

These classes are children of a parent class called genHtml which is non-public and contains all the methods to receive parameters from foxisapi.dll, retrieve data from a VFP database, and return HTML on the fly. GenHtml keeps the process of myapp.exe alive and loaded in the NT server. Its also opens the database and tables, and keeps all of them open for use by subsequent hits from the web browser.

GenHtml also creates some public variables that are useful for storing the physical path to the data files, and to store the current instance number for every web hit, which is decreased in the destroy method.

Each of these 15 classes is configured for multi-use in the project.

The ini file foxisapi.ini has the following entries:
[foxisapi]
busytimeout = 10
releasetimeout=14
statusurl = Status
reseturl= Reset
SingleModeModeUrl = SingleMode
MultiModeUrl=MultiMode
DefaultServer=myapp.logon.startup

[myapp.bio]
myapp.bio=4

[myapp.dat]
myapp.dat=4

[myapp.ant]
myapp.ant=4

...etc...for the rest of the 15 classes.

The size of myapp.exe is 665KB on the hard disk. The first time it is loaded in memory, the process has a size between 6000KB and 7000KB. However, with every request coming from the web, the size increases then decreases by a few KB. The problem is that it increases more than it decreases, ultimately making the process grow to more than 16000KB. Of course after 8 minutes of inactivity, NT deletes the process from memory, but that cannot guarantee that the process is not going to eat alot of memory before it becomes idle and is deleted.

Note that there are no queries invloved in any of the classes; only business rules coded in VFP, and simple Locate commands to retrieve the correct data. The returned output is a string of HTML tags and JavaScript functions that are hard coded in the methods of the parent and children classes. When the output is being created, it is concatenated to a file on the hard disk with:

* m.tmp is a variable with the value temp.htm
SET TEXTMERGE TO (m.tmp)
SET TEXTMERGE ON NOSHOW
\\HTTP/1.0 200 OK
\Content-Type: text/html
...etc... where all the html is added to temp.htm, then at the end:
SET TEXTMERGE OFF
SET TEXTMERGE TO
CREATE CURSOR temp (mm memo)
APPEND BLANK
APPEND MEMO mm FROM (m.tmp)
rv = temp.mm
USE IN temp
RETURN m.rv

The question is, how can I control the size of the process in memory?
If anyone has suggestions and wants more details about code, please let me know. Thanks.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform