Discussion:
Page File Used Up and Freezes
(too old to reply)
Gary Smit
2008-11-25 13:00:46 UTC
Permalink
I am having a problem with my app using up page file memory.
Below is the code I am using to call the forms:

function Menu_EditEstimate
local m1
_app.EstimateID=0
set procedure to estlocate.wfm additive
m1=new EstLocateForm()
m1.text = "Estimate Number Search"
m1.mdi = false // ensure not MDI
m1.readModal()
m1=null
if _app.EstimateID=0
_app.oEstMgr.SetFocus()
else
_app.oEstMgr.oOpen1=new object()
set procedure to newest.wfm additive
_app.oEstMgr.oOpen1=new newestform()
_app.oEstMgr.oOpen1.text = "Edit ESTIMATE Number"
_app.oEstMgr.oOpen1.mdi = false // ensure not MDI
_app.oEstMgr.oOpen1.readModal()
_app.oEstMgr.oOpen1=null
_app.oEstMgr.SetFocus()
endif
return

The problem is that after this is called repeatedly (to edit one estimate after another) the page file usage increases every time the above code is called. After about 7 consecutive calls the application freezes. If I close the application before this, the page file usage goes back down to where it was before I opened the app.

Could anyone tell me what I would need to do to be able to repeatedly open the function above without exiting the app after 6 times?

The estlocate.wfm is the user interface to find an estimate, the newest.wfm is the user interface to add or edit an estimate record.
The newest.wfm opens various .dbf files, .dmd files and .cc files.

My thought was that I wasn't releasing something from memory but I thought that happened automatically.

Any help or comment is appreciated.

Thanks,

Gary Smit
Ken Mayer [dBVIPS]
2008-11-25 13:31:12 UTC
Permalink
Post by Gary Smit
I am having a problem with my app using up page file memory.
function Menu_EditEstimate
local m1
_app.EstimateID=0
set procedure to estlocate.wfm additive
m1=new EstLocateForm()
m1.text = "Estimate Number Search"
m1.mdi = false // ensure not MDI
m1.readModal()
m1=null
if _app.EstimateID=0
_app.oEstMgr.SetFocus()
else
_app.oEstMgr.oOpen1=new object()
// Why this line? It is pointless ...
Post by Gary Smit
set procedure to newest.wfm additive
_app.oEstMgr.oOpen1=new newestform()
_app.oEstMgr.oOpen1.text = "Edit ESTIMATE Number"
_app.oEstMgr.oOpen1.mdi = false // ensure not MDI
_app.oEstMgr.oOpen1.readModal()
// release the form object
_app.oEstMgr.oOpen1.release()
Post by Gary Smit
_app.oEstMgr.oOpen1=null
// close the form file:
close procedure newest.wfm
Post by Gary Smit
_app.oEstMgr.SetFocus()
endif
return
The problem is that after this is called repeatedly (to edit one estimate after another) the page file usage increases every time the above code is called. After about 7 consecutive calls the application freezes. If I close the application before this, the page file usage goes back down to where it was before I opened the app.
Could anyone tell me what I would need to do to be able to repeatedly open the function above without exiting the app after 6 times?
The estlocate.wfm is the user interface to find an estimate, the newest.wfm is the user interface to add or edit an estimate record.
The newest.wfm opens various .dbf files, .dmd files and .cc files.
My thought was that I wasn't releasing something from memory but I thought that happened automatically.
Any help or comment is appreciated.
In addition to notes above, you might make sure in the form that you
release any open queries/databases in the form's onClose event handler.

Ken
--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase/dBASEBooks.htm
http://www.goldenstag.net/dbase
Gary Smit
2008-11-25 22:48:02 UTC
Permalink
Post by Gary Smit
I am having a problem with my app using up page file memory.
function Menu_EditEstimate
local m1
_app.EstimateID=0
set procedure to estlocate.wfm additive
m1=new EstLocateForm()
m1.text = "Estimate Number Search"
m1.mdi = false // ensure not MDI
m1.readModal()
m1=null
if _app.EstimateID=0
_app.oEstMgr.SetFocus()
else
_app.oEstMgr.oOpen1=new object()
// Why this line? It is pointless ... ?? If you mean the set procedure line below, without it I get an error
Post by Gary Smit
set procedure to newest.wfm additive
_app.oEstMgr.oOpen1=new newestform()
_app.oEstMgr.oOpen1.text = "Edit ESTIMATE Number"
_app.oEstMgr.oOpen1.mdi = false // ensure not MDI
_app.oEstMgr.oOpen1.readModal()
// release the form object
_app.oEstMgr.oOpen1.release()
Post by Gary Smit
_app.oEstMgr.oOpen1=null
close procedure newest.wfm
Post by Gary Smit
_app.oEstMgr.SetFocus()
endif
return
The problem is that after this is called repeatedly (to edit one estimate after another) the page file usage increases every time the above code is called. After about 7 consecutive calls the application freezes. If I close the application before this, the page file usage goes back down to where it was before I opened the app.
Could anyone tell me what I would need to do to be able to repeatedly open the function above without exiting the app after 6 times?
The estlocate.wfm is the user interface to find an estimate, the newest.wfm is the user interface to add or edit an estimate record.
The newest.wfm opens various .dbf files, .dmd files and .cc files.
My thought was that I wasn't releasing something from memory but I thought that happened automatically.
Any help or comment is appreciated.
In addition to notes above, you might make sure in the form that you
release any open queries/databases in the form's onClose event handler.
Ken
--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/
*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase/dBASEBooks.htm
http://www.goldenstag.net/dbase
Thanks for your comments Ken,

I am not sure which line you thought was pointless..., I put the question marks above.

I added in the lines you suggested and added to the onClose event hander of the newest.wfm the following:

function form_onClose
close procedure GPSButtons.cc
close procedure :FormControls:SEEKER.CC
close procedure ESTMGRB.DMD
return

These items did reduce the page file memory used per instance but I still have page file usage increasing but at a slower pace.
I am assuming that closing the procedure ESTMGRB.DMD above will also release opened queries by that .DMD file correct?

Is there something else I might be missing?

Thanks again for your help.

Gary Smit
Ken Mayer [dBVIPS]
2008-11-26 05:54:34 UTC
Permalink
Post by Gary Smit
Post by Gary Smit
_app.oEstMgr.oOpen1=new object()
// Why this line? It is pointless ... ?? If you mean the set procedure line below, without it I get an error
I was referring to the line above the comment. The "new object()" line
is completely unnecessary considering the line *after* the "set
procedure" statement below ...
Post by Gary Smit
Post by Gary Smit
set procedure to newest.wfm additive
_app.oEstMgr.oOpen1=new newestform()
// release the form object
_app.oEstMgr.oOpen1.release()
Post by Gary Smit
_app.oEstMgr.oOpen1=null
close procedure newest.wfm
Post by Gary Smit
_app.oEstMgr.SetFocus()
endif
return
Thanks for your comments Ken,
I am not sure which line you thought was pointless..., I put the question marks above.
function form_onClose
close procedure GPSButtons.cc
close procedure :FormControls:SEEKER.CC
close procedure ESTMGRB.DMD
return
These items did reduce the page file memory used per instance but I still have page file usage increasing but at a slower pace.
I am assuming that closing the procedure ESTMGRB.DMD above will also release opened queries by that .DMD file correct?
I would suggest actually, considering releasing the queries used in the
datamodule ... just closing that does not release the objects. As you
can see, memory management in object-oriented code can be a real trial
at times. <g>

Ken
--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase/dBASEBooks.htm
http://www.goldenstag.net/dbase
Loading...