Heap memory problems

There is self-service WCF, which should work 99% of the time. Sometimes we have some memory problems:

memory leaks

But after that, the services work as usual. How can we do this? Any tips and tricks for creating reliable services that will survive in different situations are very welcome.

+7
source share
4 answers

I'm not too sure where the problem is, but a memory leak could be the cause.

All code is managed. And we use dotConnect for Oracle from devArt as a data-level library.

You assume that all code is managed, but there may be unmanaged parts. However, you must call the Dispose method for all disposable objects after using them, do not think that they are correctly selected as soon as they go out of scope. Best practice is to allow disposable objects to get out of scope without calling the Dispose method. You can use the 'using' statements if you use them as local variables.

DbConnection is a good example for one-time objects, make sure you have all the connections (one-time objects).

+3
source

If this is a WCF problem (I'm not sure what to do with your dump), I suggest you activate WCF server-side tracing and look at the exceptions if they exist (and edit your question so that we can help you).

Here is a link that explains how to do this:

How to enable WCF tracing

0
source

What are your service activities, in particular ConcurrencyMode and InstanceContextMode.

if you have Multiple like ConcurrencyMode and InstanceContext installed (PerCall or PerSession (default)), you can definitely run into problems if you have large DataStructures or unallocated resources.

if you use multiple Concurrency try InstanceContextMode Single [ServiceBehavior (ConcurrencyMode = ConcurrencyMode.Multiple, InstanceContextMode = InstanceContextMode.Single)]

0
source

Do you have 100% no dependencies on unmanaged code? I saw something very similar to this, and this was because we were freeing up memory, which another process would also try to free up later.

0
source

All Articles