troubleshooting Question

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

Avatar of Intersection
Intersection asked on
Windows XPVisual Basic.NET
1 Comment1 Solution1222 ViewsLast Modified:
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
ASKER CERTIFIED SOLUTION
Intersection

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros