WCF Serialization and Caching

I have a WCF service hosted in a console application. and I have ChannelFactoryto call WCF Contracts.

Problem: when I call the operation returning the values, it seems that the returned value is cached somewhere by the service when it is serialized.

I check the use of service memory through the task manager under windows 7. When I call an operation that returns nothing, the memory does not increase, but when I call an operation that returns data, the memory grows and stays that way even after the data is returned to the customer.

I assume this is a serialization caching issue?!?

+3
source share
3 answers

, , , GC , , .

- , , ? , WCF ; , , .


Edit:

, . , GC.

MSDN: http://msdn.microsoft.com/en-us/library/ee787088.aspx#conditions_for_a_garbage_collection

, :

  • .

  • , . , . .

  • GC.Collect. , . .

, , GC'd, GC ( , ).

, WCF , , , , -. , , , .


# 2:

. : #

+2

, , - . , WCF GC , .

+3

, , /: http://memprofiler.com/

I would not worry too much if the GC does not start after every call - it will not be very effective in any case - the garbage collector will work at the moment when the .NET environment determines that the objects are old enough to be collected. If memory starts to run low, this will happen more often.

+1
source

All Articles