Computers that have lots of RAM installed seem to more slowly process data in Visual FoxPro (176483)



The information in this article applies to:

  • Microsoft Visual FoxPro 9.0 Professional Edition
  • Microsoft Visual FoxPro 8.0
  • Microsoft Visual FoxPro for Windows 7.0
  • Microsoft Visual FoxPro for Windows 6.0
  • Microsoft Visual FoxPro for Windows 5.0a
  • Microsoft Visual FoxPro for Windows 5.0
  • Microsoft Visual FoxPro for Windows 3.0b
  • Microsoft Visual FoxPro for Windows 3.0

This article was previously published under Q176483

SYMPTOMS

Sometimes when you manipulate a table with certain FoxPro commands, the record counter on the status bar pauses or stops for long periods of time. The hard drive continues to process information. This problem is more noticeable on faster computers that have large amounts of RAM installed.

RESOLUTION

Set the foreground buffer of SYS(3050) to a smaller number. Here's an example:
     =SYS(3050,1,10000000) && Sets the foreground buffer to 10 million
                           && bytes.
				

STATUS

This behavior is by design.

MORE INFORMATION

Using the commands COPY, APPEND, DELETE, INDEX, PACK or SQL-SELECT on a large table in Visual FoxPro causes long pauses while the data is being manipulated. The hard drive continues processing the data, but Visual FoxPro seems to be inactive. This happens because computers that have large amounts of RAM and are running Windows 95 or Windows NT give Visual FoxPro a large amount of buffered memory to use. This memory is composed of RAM and physical hard drive space. When FoxPro writes data into memory, large temporary files are created. When they are written to the virtual memory (the hard drive), that memory is always slower. Using a smaller amount of foreground buffer memory with SYS(3050) makes Visual FoxPro use only the RAM memory, which is faster. Reducing the foreground buffer size has eliminated the long delay in most situations.

Steps to reproduce the behavior

  1. Use a computer with 64 MG of RAM or more, Visual FoxPro, and a table that contains 2 million or more records.
  2. Open the table, issue a SET STATUS BAR ON, and a COPY TO test in the FoxPro Command window.
  3. Watch the record counter on the status bar as it starts counting the copied records. After a while, the counter stops but the hard drive continues to process data. Later, the record counter starts counting again and then pauses after doubling the last record count.
  4. Press the ESC key after watching this behavior, and type the following in the FoxPro Command window:

            =SYS(3050,1,10000000)  && The 10 million number can be changed to
                                   && suit individual situations.
    								

  5. Issue a COPY TO test command again and note that the counter does not pause as long this time.

REFERENCES

Visual FoxPro Help File: SYS(3050)

"Foxtalk," February 1997, "Set Turbo On: How Visual FoxPro Memory Usage Affects Performance," page 1, Flavio Almeida and Walter Loughney

Modification Type:MajorLast Reviewed:3/11/2005
Keywords:kbMemory kbPerformance kbprb KB176483