Skip to main content
Microsoft Silverlight
Home Forums General Silverlight Programming Report a Silverlight Bug Silverlight 3 creates a lot of XCP temp files (20MB each)
8 replies. Latest Post by jony11 on July 14, 2010.
(0)
erikloman
Member
0 points
4 Posts
10-12-2009 4:29 PM |
Hi all! We are writing a Silverlight 3 management interface for our appliance. A soap client request is made every 5 seconds to update the on-screen runtime values. But with every request Silverlight is writing an XCP*.tmp file of 20.971.520 bytes (20MB!) to the temp folder. Can somebody please explain why Silverlight 3 is creating these huge XCP tmp files in the %temp% folder? And perhaps provide a solution to prevent this from happening? Regards, Erik
Jonatha...
All-Star
41770 points
4,104 Posts
10-19-2009 6:24 AM |
Hi Erikloman,
For the safety consideration, Silverlight cannot access to the client folders/drivers except the Isolated Storage. Its default size 1M and we can extend it.
Best regards,
Jonathan
10-19-2009 1:35 PM |
I don't thing this has anything to do with Isolated Storage or accessing client folders/drives. When creating a soap request and setting the MaxBufferSize of the Binding to a large value (ex. 20MB) causes Silverlight to write XCP*.tmp files in the %temp% folder for each and every request without cleaning it up until the Silverlight control closes. So if you have 100 requests to update your runtime values UI it easily eats up your hard drive space. Does someone have a solution?
dgonth
4 points
11-11-2009 3:17 PM |
I am making frequent SOAP calls in the same way for the same reason as you and I'm seeing the same problem. I am not setting MaxBufferSize to a large value but I am setting MaxReceivedMessageSize on the binding to 1024000.
The idea that a SOAP call in a silverlight app can chew up that much disk space on the users machine (completely ignoring any browser temporary file cache limits) is pretty scary. I can't believe someone from Microsoft hasn't come back with more information. The replies to date have not been helpful.
I did find one workaround that helps. I was creating a binding and using it to initialize the SoapClient object making the calls. I would then reuse the SoapClient object. I found that destroying the SoapClient object and recreating it for each call instead of reusing it causes the tmp files to eventually be destroyed, probably as the SoapClient object or the binding is garbage collected.
c1johnj
2 points
1 Posts
11-12-2009 3:22 PM |
Another workaround is to call GC.Collect() directly at the end of your async event handler. This will clean up the previously created temp file.
phobos7
8 Posts
02-05-2010 8:46 AM |
I've tested this, reproduced the problem, and proven that calling:
GC.Collect();
does appear to clear up the XCP files.
I've written up my brief findings in a blog post.
markspe...
60 points
25 Posts
03-08-2010 7:57 AM |
Introducing Garbage collector will save the disk space and certainly helps application to execute much faster, IMHO.
rockallm
05-24-2010 9:42 AM |
We have a Silverlight application with the same problem. We ensured CloseAsync calls are specified after web service calls throughout the code, and added GC.Collect statements too, but for users at client PCs, runing on either IE7 or IE8, the XCP* files are still generated. On some PCs those files do go, on others they remain until IE is closed. Depending on te disk space free, these PCs are soon dangerously low on disk space (full.) So we cannot continue to use the application. Changing the IE settings to not use HTTP 1.1 protocol means that the XCP* files are not generated, but this also stops the web service response messages to the client from being compressed. In our circumstances, that is also undesirable. Ideally we need to be able to compress web service responses, and have these decompressed at the client PC in memory, without touching the client PC disk space at all. What settings are needed to do this, and does the client PC need any particular software? Any idea what components existing at the PCs would give the different results we are experiencing ?
jony11
07-14-2010 6:01 AM |
Hi Friends, I am Cine and I have read your site in a very deep and I would like to appreciate you on this brilliant effort. You have provided some thing so much different that I can't have words for thanks.