I'm using AppFabric for dataCaching to store data that are returned from database. One of my Stored Procedures returns a huge amount of data about 500,000 rows. When I try to store these data into the App Fabric caching I get the following exception.
Failed to allocate a managed memory buffer of 134217728 bytes. The amount of available memory may be low.
I have changed the maxBufferSize to 50MB. Is it large enough. Documentation from Microsoft lacks. No suggested values for the configuration of AppFabric. nothing.
Anyone has any idea what's the problem?
- 已编辑 pantonis 2012年5月21日 14:41
Can you provide a stack trace for the said exception? I suspect the issue is that WCF needs 134MB to serialize your object and that kind of memory is unavailable, leading to an InsufficientMemoryException. How large is that object you're trying to serialize? Could you try serializing it in isolation and check the size of the serialized item?
How can I check the size of the serialized item?
Cache uses NetDataContractSerializer for serializing user object by default. You can try serializing your object using this serializer to see what is the size of your serialized object.