We help IT Professionals succeed at work.

File.Copy() many times results in "System PTE" depletion and evenutally system crash

1,190 Views
Last Modified: 2008-08-12
Hello Experts!

Im working on a VB.net file management program that copies 100,000s of small images (20 - 300 KB).
At least it tries to. When doing large multi-hour operations I start getting exceptions with the
"Insufficient system resources exist to complete the requested service." error message.
In a few cases the computer has then crashed.
After a lot of debugging, finally with livekd kernal dump I can see that the System PTEs in the Kernel Mem are getting very low.. enough that kd had a message "******** running out of system PTEs *********"

Now I can monitor the PTE's in realtime with Performance Monitor with the Memory/Free System Page Table Entries.

I observe that after an hour or so the PTE's start dropping in what appears to be linear fashion as the program keeps copying.
Im sure it is the copy function causing the problem, because when i comment out the copy routine, the free PTEs stopped going down.

Behaviour is identical with both of these calls.
System.IO.File.Copy(strFileSource, strFileDest, bOverwriteFile)
My.Computer.FileSystem.CopyFile(strFileSource, strFileDest, bOverwriteFile)

If I stop & close the program, PTEs do not seem to rebound at all. If I start the program again, the PTEs again start going down.

SO: What is up with File.Copy? Why is it using and not releasing all these PTE's? Seems this memory should be free after the copy.
How can I change my code to avoid running up the PTEs?

Thank you for any ideas, advice, assistance!
-Christopher

NOTE: That I asked this question before, but Ive learned enough about the problem that I decided to repost:
https://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_23570769.html


Notes:
The test computer is Windows XP sp2 with 500MB ram. (also been testing with 1.5 G ram)

Ive found some helpful documents on PTEs, which discuss system configuration. But this is not really an option for me as this is a commercial product that others will be using on their own computers.

Detection, Analysis, and Corrective Actions for Low Page Table Entries.
http://www.microsoft.com/downloads/thankyou.aspx?familyId=ed0e8084-abf7-4c00-ba6a-7d658cdb052a&displayLang=en

http://blogs.technet.com/clint_huffman/archive/2008/04/07/free-system-page-table-entries-ptes.aspx
Comment
Watch Question

This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.