We are developing a large ASP.NET application. The Application uses the below:
- Entity framework as a data access layer.
- WCF as a communication layer, that uses the ChannelFactory to create channels, (each call has a new channel), the WCF services are hosted in a windows services and uses WSHttpBinding.
SQL Server 2008 R2
Sometimes, we are using the TransactionScope in the business layer to create transactions.
- The database contains large amount of data, that is passed through WCF.
- All our Entity Framework ObjectContext are wrapped inside using statemnt to ensure they are disposed.
- Each WCF Channel is disposed after it is used.
- We have long running transactions that runs in the background, which contains many and frequent database access also through WCF.
Mainly we have two critical problems:
- we have some kind of memory leak. The Memory of the WCF service host keeps increasing up and up especially with large data.
- The Memory of the SQL server also increases up and up.
These problems makes the application very slow and sometimes does not respond, which force us to restart the wcf and sql services.
The application is hosted on a windows server 2008 environment that has 4 GB RAM.