I am trying to write a program that does some reading/processing/writing.

While everything works fine when I give my program a local path, I am faced with an unusual problem: huge memory usage when I process files over the local area network.

If the file path is something like "//network_address/folder/*.ext" the program uses about 4G RAM (as opposed to 500 - 1G when the path is something like "c:/folder/*.ext")

I used Process Monitor to see what is going on and noticed consistent read failures in the "c:\windows\csc\v2.0.6\namespace" folder - which I hadn't even known existed. Researching it, I found that it was used to sync files with a network server, perhaps to view network files offline.

The above failures were happening exactly before a write to file process started (not before reads), the namespace folder did not get used, I had nothing synced, and the actual writes to the network drives were successful.

I haven't set up any option to sync folders... (and I don't want to)

As soon as I took ownership of that folder, the memory usage went down (though I still got read errors in Process Monitor).

So... I think my problem is I have been trying to do something I am not allowed to, and using a lot of memory to hold data while I am trying to do what I am not allowed, until I fail and finally put the data where it belongs...

The solution: avoid doing things that I am not allowed to do, right ?

Is there a way (preferably a command line that I can run in my code, or a registry entry I can modify) that can prevent my program from syncing files (if that is what is happening) or using that namespace folder when reading off a network drive ?

How can I prevent Windows from syncing files behind my back, and just writing files directly to the network folder ?

  • From reading your question, I must assume that you're misinterpreting your observations in Process Monitor. If procmon shows read failures in the CSC cache, that sounds like something I would expect if Offline Files is turned off. Otherwise it wouldn't be a read failure, it would be a read success. So, I would assume the issue is a different one. I think your problem might be more programming related as the solution might best be obtained through debugging and profiling. Good luck :) – Der Hochstapler Jul 6 '12 at 22:46
  • @OliverSalzburg: Thanks, I haven't looked at it this way - still when I took ownership to the folder, the memory used dropped dramatically... So I was hoping of a way to simply not use it. – Thalia Jul 6 '12 at 23:09

Did you figure this out yet? Try disabling Offline Files inside the share:

  1. Right click the share
  2. Go to the Sharing Tab
  3. Click on the Advanced Sharing button
  4. Click on the Caching button
  5. Select “No files or programs from the shared folder are available offline.”
  6. Click OK to close the Offline Settings pop up
  7. Click OK to close the Advanced Sharing pop up
  8. Click Close to close your share’s property box

Another thing you could try from the client PC is to disable the Offline Files service if this is Win7/Vista.

Let us know how it works out.

  • The network shares that I was trying to access don't belong to me, and therefore I have no access to the Sharing settings. They are Shared with everyone on the network... (offline availability: Not available). Still to me it made a difference when I changed the settings in the CSC cache folder - I still don't understand why or don't know how to revert the change so I can test my hypothesis. – Thalia Jul 18 '12 at 20:00
  • what specific changes did you make? And how did you make them? – cwheeler33 Jul 21 '12 at 14:48
  • As I stated in my original post, I took ownership of that folder. – Thalia Jul 23 '12 at 3:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.