Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP Garbage Collection - Any Ideas?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00464933
Message ID:
00465087
Views:
17
>I'm hoping someone knows how to force VFP to do garbage collection.
>For example, on an NT machine with task manager watching the VFP memory allocated, I type:
>
>x = space(16777184) ' VFP allocates between 20-36meg of RAM
>x = Null
>Release x ' RAM stays allocated
>
>CLOSE ALL
>CLEAR ALL ' No luck - still allocated
>
>Is there any way to force memory allocation? SYS(3050) has
>no effect on this kind of memory allocation.
>
>We have a citrix box with many VFP apps running, and if one
>user runs a VFP routine which needs RAM, the RAM is staying
>allocated to that user indefinitely, slowing the other users
>down.
>
>If anyone has any insites, I would be very thankful.
>
>TIA,
>Ed

I have had nightmarish expereriences with CITRIX and VFP. The two don't play well together. Adjusting foreground and background memory helps. The program below I modified from another post to fit my needs. It's a pretty generic approach and works well. What I finally did was distribute a VFP frontend via CITRIX, but the backend was SQL Server. This improved performance ten fold. (Less data going over the wire.)
*  Program...........: MEMADJUST.PRG
*  Project...........: TSM50
*  Created...........: 01/05/01  12:24:32
*  Copyright.........: (c) InvestLink, 2001
*) Description.......: Adjusts forground and background memory
*  Calling Samples...:
*  Parameter List....:
*  Major change list.:
Local lcOrigFore, lcTotMem, lnRealMem, lcMem

Clear

lcOrigFore = SYS(3050,1)
lcTotMem=SYS(1001) && Total available memory to VFP, including VM
lnRealMem=VAL(lcTotMem)/4 && Get the physical memory from the pool
lcMem=SYS(3050,2) && default background memory!

If VAL(lcMem) > 10000000 && The default background should work fine
     =SYS(3050,1,VAL(lcMem))
Else
     =SYS(3050,1,lnRealMem/4) && Reduce the physical memory pool by 4
     =SYS(3050,2,lnRealMem/4)
Endif

lcOrigFore          = ALLTRIM(STR(INT(VAL(lcOrigFore)/1000000)))  && Original
lcForground      = ALLTRIM(STR(INT(VAL(SYS(3050,1))/1000000))) && foreground
lcBackground    = ALLTRIM(STR(INT(VAL(SYS(3050,2))/1000000))) && background

? "Original Foreground Memory: " + lcOrigFore + " megs"
? "Total Available Memory: " + ALLT(STR(lnRealMem/1000000)) + " megs"
? "Forground memory: " + lcForground + " megs"
? "Background memory: " + lcBackground  + " megs"
Previous
Reply
Map
View

Click here to load this message in the networking platform