Link to home
Start Free TrialLog in
Avatar of Intersection
Intersection

asked on

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

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/questions/23570769/Copy-many-files-without-maxing-out-Kernel-Paged-Memory-Pool.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
Avatar of Intersection
Intersection

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial