Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP Memory Management - SetProcessWorkingSetSize

API Functions

VFP Memory Management - SetProcessWorkingSetSize

by  dagair  Posted    (Edited  )
When Sys(1104) and Sys(3050) have had no effect on memory and VFP application stability and error prevention, I have found SetProcessWorkingSetSize to be very useful.

proc CutWinMem
Declare Integer SetProcessWorkingSetSize In kernel32 As SetProcessWorkingSetSize ;
Integer hProcess , Integer dwMinimumWorkingSetSize , ;
Integer dwMaximumWorkingSetSize
Declare Integer GetCurrentProcess In kernel32 As GetCurrentProcess
nProc = GetCurrentProcess()
* param2 = minimum set size, param3 = max set size --> -1 is to reclaim as much page memory as possible
bb = SetProcessWorkingSetSize(nProc,-1,-1)

I had difficulties with report output causing 'insufficient memory' errors and this solved the problem. Additionally, over terminal services I was having a problem with macro expansion not being enterpreted correctly and consistently and this seemed to resolve the problem...

Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top