Foxpert Software Development & Consulting

Menu

Whitepapers
Downloads
Knowlbits
Guineu

2007-03Mar-01

Using FileMon

FileMon is a great utility if you need to debug performance problems in a Visual FoxPro application. After launching FileMon.EXE as an administrator change the filter to "VFP9.EXE" or the name of your application. When you now run your application, you can see all disk activities in your application.

One major pattern to watch out is a long list of read accesses on a single DBF file. These are usually table scan that are the result of un-optimized queries or frequent aggregations such as calculating sums or counts. When you test on a local machine you rarely notice these operations as a delay since your hard disk is fast enough to read dozens of MB in just one second. On a shared network, though, bandwidth is really criticial.

FileMon is pretty good at telling you what went wrong. However, it doesn't help you to relate this with the actual line numbers in your code. To achieve this I use markers in my Visual FoxPro application. A marker looks like this:

=FILE("MyClass.MyMethod.BeforeScan")

That is, I check for the existence of a not existing file. In FileMon this line produces output similar to the following:

11:14:08.182	vfp9.exe:2776	FASTIO_QUERY_OPEN
C:\DOCUMENTS AND SETTINGS\CHRISTOF\MY
DOCUMENTS\PROJECTS\lib\MyClass.MyMethod.BeforeScan
FILE NOT FOUND	Attributes: Error	

Now I can search for my markers in FileMon. I can be confident that all activities between two markers have been caused by the code between the two markers. By adding and moving markers I can quickly identify the lines that cause most traffic in an application.

Previous KnowlBits

RSS

October 2009 (2)

September 2009 (1)

August 2009 (4)

July 2009 (2)

June 2009 (2)

May 2009 (1)

April 2009 (1)

March 2009 (1)

August 2008 (1)

July 2008 (2)

May 2008 (1)

April 2008 (2)

January 2008 (2)

December 2007 (2)

November 2007 (2)

October 2007 (1)

September 2007 (1)

August 2007 (5)

July 2007 (4)

May 2007 (6)

March 2007 (3)

February 2007 (7)

January 2007 (6)

November 2006 (1)

October 2006 (3)

September 2006 (10)

June 2006 (2)

May 2006 (6)

April 2006 (1)


Impressum Kontakt Contact