Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Memory issue
Message
From
20/12/2001 09:49:42
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00558568
Message ID:
00596746
Views:
37
James, in your code below, why if the default backgound memory usage is > 10000000, is that considered ok, and if not, why are you dividing by 4? Also why are you not optimizing the foreground memory unless the backgound memory is not ok? Am I not understanding the code below correctly? I'm researching this because I'm trying to optimize vfp on win95/98/2k systems and I want to limit the amount of memory vfp uses the way I used to do it in FPD26 with a memlimit setting of: 80,1024,1024 in the config.fp

TIA,
Tracy

>>The amount of memory VFP allocates to data buffers is determined by the settings of SYS(3050). The setting for when VFP is in the background is by default 1/4 of the foreground setting. When you minimize VFP or Alt+Tab to another application, the background setting is used, and as you have seen the memory usage is reduced, as long as the background buffer size is smaller. You can limit the amount of memory used by the data buffers by reducing the size of the SYS(3050) settings.
>>
>>SYS(3050,1) sets or returns foreground memory, and SYS(3050,2) set or returns background memory. You can force either of the buffers to be flushed by setting the buffer size to its minimum, which is 256KB. Any data which exceeds the buffer size will be written to disk in either tables or temp files. You could try periodically setting SYS(3050) to the minimum, and back, or simply start with a smaller setting.
>>
>>
>>Jim Saunders
>
>I have a pretty good routine for optimizing the memory. It is a rather general approach to doing this:
>
>
*  Program...........: MEMADJUST.PRG
>* Author............: James M. Weil
>* 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"<\pre>
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform