Done. Thanks Mike!

As I said in another response, I have used this in all my Windows VFP 
apps for many years...it was already in the application I'm having speed 
issues with...I re-enabled it and unfortunately it didn't help.

****************************************
func SetMem
* Requests free RAM memory value from Windows, sets VFP to only utilize 
that amount.
* Prevents slow performance for users who run many apps at the same time.
* Keep with CHARTOBIN function below!!
LOCAL lnAvailableMem, lpMemoryStatus, lnPct
DECLARE GlobalMemoryStatus IN Win32API STRING @lpMemoryStatus
lpMemoryStatus = REPLICATE(CHR(0), 32)
GlobalMemoryStatus(@lpMemoryStatus)
lnAvailableMem = CharToBin(SUBSTR(lpMemoryStatus, 13, 4))
     * Fine tuning option. Specify a decimal value to allocate less than 
100%
     * i.e. .5 would be 50%
*!*    lnPct = 1
*!*    IF TYPE("main.nSetMemoryPct") == "N"
*!*    lnPct = goApp.nSetMemoryPct
*!*    ENDIF
*!*    lnAvailableMem = (lnAvailableMem * lnPct)
SYS(3050, 1, lnAvailableMem)
SYS(3050, 2, (lnAvailableMem/2) )
RETURN lnAvailableMem
*********************************************
func CharToBin
param tcWord
* only called by SETMEM()
LOCAL lnChar, lnWord
lnWord = 0
FOR lnChar = 1 TO LEN(tcWord)
     lnWord = lnWord + (ASC(SUBSTR(tcWord, lnChar, 1)) * (2 ^ (8 * 
(lnChar - 1))))
ENDFOR
RETURN lnWord
*********************************************

I'm pretty sure that's the one.

Mike

> On 3/3/2011 10:55 AM, Tracy Pearson wrote:
>> I wonder if this much memory ends up swapping.
>> This might be a good reason to change the SYS(3050) settings.
>> Perhaps your Config.fpw might need the old MEMLIMIT, which may not work in
>> VFP 9 at all
>
> Use Ed Leafe's Setmemory.prg.  It's in the Downloads section on ProFox.
>

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to