>>>Jim,
>>>
>>>When running on a system with 32 MB of physical memory and NT 4.0 workstation as the O. S., I have very little memory left over. Yes, it is causing me a performance problem!
>>>
>>>If .dll's were built instead of .app's, or if everything was compiled into the main .exe instead of multiple .app's, could the memory usage be lowered considerably?
>>>
>>
>>Nope. VFP's memory manager can (and will) use any and all memory available to it for an application, regardless of whether it's compiled into an .APP or a .EXE (the only difference is how the VFP runtime itself gets started up; it's the same runtime regardless of how the app is compiled unless you're running under the development version, in which case, it's the same development engine being fired up regardless of whether it's compiled to an .APP or an .EXE file.
>>
>>This sounds more like a problem with how your NT system is configured than with VFP, though - even if you have only 32MB of RAM available, your can (and should) have more memory available as virutal memory throguh the swap file, and when the VFP app isn't active, it can (amd will be) paged out of physical RAM.
>>
>>>Thanks
>
>Ed,
>
>I just found your message doing a search on "memory usage"
>
>This line caught my attention
>
>
Visual FoxPro's memory manager can (and will) use any and all memory available to it for an application>
>Is there no way to limit VFP's mem usage? I've tried sys(3050) but it doesn't behave as I expect ( maybe I'm missing something there ). At any rate, when I run a particular app on the server, everybody slows down because the app is using nearly 100% of the server's RAM. I guess, for mem-swapping purposes, the server OS doesn't qualify as an application.
>
SYS(3050) needs to be set explicitly for both foreground and background use - this is part of the problem. SYS(3050) only limits VFP's use of memory for buffering purposes - repetitive use of a lot of ill-behaved COM servers will bump VFP's usage of memory regardless of other settings (VB apps will do this, too). If you rely on SYS(3050), make certain to set the value for both foreground and background - it's likely that you've set SYS(3050,1) without setting SYS(3050,2). By default, VFP will set large numbers for the values, with SYS(3050,1) being ~4x the size of the SYS(3050,2) value - I think it defaults to ~80MB on a system with 128MB of physical RAM installed.
There is a small base of memory allocated to the operating system for non-swappable purposes - VFP will grab anything available for caching or other swappable memory (like other applications).