.net - Possible Memory Leak In Asynchronous .NET Call To A WebService?

Sep 16, 2010

I've created a small class library to asynchronously call a WebService(Fire and Forget. I don't need the result).In a Windows Form application, the XXXAsync() method works fine. But, in a Web Application, the process is locked until the XXXCompleted event is fire.My problem is: I tried to create a Delegate and use the Begin/EndInvoke to call the XXXAsync() method. It worked fine, but, the w3wp process seems to be consuming a huge amount of memory. I'm calling the EndInvoke method properly. Invoking the GC.Collect did not free any memory

View 1 Replies


Similar Messages:

DataSource Controls :: Memory Leak - Server Will Crash - Log A Ton Of SQL Errors Stating That It Is "out Of Memory"

Jul 27, 2010

I have a memory leak somewhere that I cant find. Every few days my server will crash, and just before that I log a ton of SQL errors stating that it is "out of memory".

I cant find it anywhere, all of my connections are being disposed like so:

[Code]....
Then I call the connection from my pages like so:[Code]....

That is all pretty straight forward. The connection is disposed because it is implementing the USING clause. I am opening the connection in my connection manager class, and not where it is being utilized?Or, could the problem be in the below method I am using to populate a SqlDataReader:[Code]....

Now, at first it appears as though this could be the problem because the Connection isn't part of a USING clause, however doesn't the 'Data.CommandBehavior.CloseConnection' pretty much do the same thing. This makes sure that the connection is closed when the reader is closed, right? Here is how I call that above reader from my login page code behind:[Code]....

So the DataReader will get closed even without the .Close() because it is in the USING, and the connection should get closed because I specified it in the ExecuteReader paramters right?

View 8 Replies

C# - Impersonation Memory Leak

Feb 9, 2011

On http://msdn.microsoft.com/en-us/library/w070t6ka(v=VS.100).aspx there is an example on how to do impersonation with .net 4.0. We have used this example in a class that inherits IDisposable for ease of use. However, when we use this class in a asp.net web application, we notice a slight but steady increase of Pool Paged Bytes in performance monitor. After a week, the application crashes.

I've tried different implementations of the impersonation-class, using http://msdn.microsoft.com/en-us/library/w070t6ka(v=VS.90).aspx and http://support.microsoft.com/kb/306158 as reference, but they all show the same leak.

Where does this leak come from? Is there a problem with the windows api? We are running Windows 2008 R2.

This is our current version of the impersonation class:

public class Impersonator : IDisposable
{
public Impersonator(string username, string domain, string password)
{
if (!ImpersonateValidUser(username, domain, password))[code]....

And this is the performance monitor graph of two webservers using different versions of the class:

When we disable the class, and use global impersonation via web.config, those lines are completely flat.

Update,I have made a test-application that successfully reproduce the problem. It can be downloaded here:

http://rapidshare.com/files/447325211/ImpersonationTest.zip

The result over 18 hours looks like this:

View 1 Replies

C# - Mscorwks.dll Memory Leak

Aug 2, 2010

We got a problem in one of our ASP.net apps, the mscorwks.dll is using a lot of memory. where to start looking for the memory leak ?

mscorwks!EEVirtualAlloc+119: 1.26 GBytes worth of outstanding allocations.

View 3 Replies

MVC :: Memory Leak In Database Factory

Jun 14, 2010

I'm writing an MVC app and want to have a central DataBase factory class to provide all my DB connections, something like this:-

[Code]....obviously I'll have to instanciate this every time I need to use it, so I was thinking of making it a static class:-

[Code].... so that instead of my controller code saying

[Code].... I can just say

but would this cause a memory leak? I'm sure I remember reading somewhere that if a static class creates objects that persist beyond it's methods and return those (esp things like DB connection objects) these won't get garbaged collected when the calling method is disposed of as they were created/referenced outside the scope of that calling (controller action) method and so will hang around in memory?

var tableObject = DatabaseFactory.GetDatabaseTable();
List<DbRecord> records = tableObject.Table.ToList();

View 9 Replies

AJAX :: UpdatePanel Memory Leak IE8?

Nov 2, 2010

I created a site which fills an UpdatePanel with dynamically created buttons when clicking on an other button. Now every time I click the button the used memory increases. I already tried the workaround from http://www.crockford.com/javascript/memory/leak.html to remove old eventhandlers before updating the UpdatePanel. But the used memory still increase. Is there a problem with my code or is there an other workaround?

Here is the code of a sample aspx site which shows the problem: [Code]....

Browser IE8

OS WinXP SP2

.Net Framework 3.5 SP1

View 3 Replies

C# - WebRequest/WebResponse Memory Leak?

Dec 7, 2010

I have an .Net Framework #4.0 application that makes a large number of web requests using the WebRequest/WebResponse classes , as i see it has memory leak (or maybe i am doing something wrong)I Wrote some small simple application that demonstrates this:

class Program
{
public static void Main(string[] args)[code]...

The only one solution i came up with is use GC.Collect() (unmarked in example) , All the object are disposed , all streams are closed , am I missing something ?I found something but i don't understand the reason , if i minimize Console the memory usage decreases and looks O.K , what can be the reason for that is there a problem with Conosole or WinForm .

View 1 Replies

Facebook - How To Find Memory Leak From ASPX App Having A DLL

Apr 30, 2010

Any tips How to figure out where is memory leak in my Facebook app, its ASPX using Facebook toolkit DLL and I am afraid the bug may be in that CS library.

The problem is that after one week uptime, server is running out of memory and needs to be rebooted, there are quite many users and I cannot run debugger on this "production server", so I would need to simulate somehow use on my local PC.

View 1 Replies

Web Forms :: Memory Leak When I Bind GridView To My Dataset?

Oct 29, 2010

I am facing problem memory leak when I bind GridView to my dataset. The dataset will be retrieve when page first loaded (Not postback) and store into session. ANy postback will reuse the dataset from session.

The problem now is, whenever any postback, the memory leak is keep increasing and till 1GB. I read some articles and mentioned it is ASP.NET databind issue. Is it true? Any workaround?

View 9 Replies

Forms Data Controls :: Memory Leak - Gridview

Jan 13, 2011

I am using DevExpress Gridview basically, and hit out of memory exception whenever I keep refresh page that contains huge data. I reported to DevExpress team and they claimed it is ASP.NET gridview issue.

Therefore, I create a simple project, a girdview to sqlDataSource. Run the page and press F5 to refresh. I use ANTS profiler to check if any object instance is keep increasing but never been disposed. I found that, memory does happen in this simple project, as what DevExpress team claimed.[Code]....

View 4 Replies

AJAX :: ToolkitScriptManager Memory Leak - Using IE7 And Have Removed All Inline JS And JS Files

Jan 17, 2011

I'm using the ToolkitScriptManager on a page so that I can use the update panel. Everytime I refresh the page the mem usage in task manager jumps up 3-4megs. I'm using IE7 and have removed all inline JS and JS files to no avail.

View 4 Replies

DataSource Controls :: Possible Memory Leak In DataTable.Select Method?

Jun 18, 2010

I have an application which was recently ported from Classic ASP to .NET 3.5. I'm pulling some data from a stored procedure and once retrieved, I'm doing using the Select method on the DataTable in a loop so I don't have to keep going back to the database.It appears that there's something wrong here as I can refresh the page repeatedly and see the memory usage increase by a few megabytes, up to the point where we get an error. If we recycle the app pool in IIS, it starts working again, for a little while.

Is there a memory leak in this method? I did some research on the subject and Microsoft said there was an issue like that in .NET 1.0 and 1.1, but I'm using a higher version.Or, is this something else, such as not managing resources correctly? Here's a snipped of my code:

[Code]....

Initially, this app was using XML instead of a datatable and using XPATH to query the data, but it was too slow. I thought using a dataset with DataTable selects was a better option, but now we found this issue. I was thinking since the loop executes several hundred times that getting all the data and filtering through it on the client was a better choice instead of calling several web methods to get the subsets of data.

View 5 Replies

Visual Studio :: VS 2010 Memory Leak When Trying To Copy & Paste Code Inside?

Oct 8, 2010

It happens frequently when I try to copy & paste code inside VS 2010 with following message:

insufficient available memory to meet the expected demands of an operation at this time, possibly due to virtual address space fragmentation. Please try later.

and I check the memory usage with taskmanager on my computer. It is fine.

In order fix it, I need to close VS 2010 and restart again.

View 1 Replies

C# - Asynchronous Webservice?

Feb 18, 2011

How can I set up an asynchronous web service in asp.net? I want to call a webservice to post some data to a database, but I don't care if the response failed or succeeded. I can use .net 2.0 or 3.5 only and it can be in vb or c#.

View 3 Replies

How To Send An Asynchronous WCF Call

Mar 18, 2011

How to make a call to my WCF service asynchronous?

Here is how I am doing it

Dim wcfService = New EmailBlastService.EmailBlastServiceClient
wcfService.WCFSubCallAsync()

But when I actually do the call it seems to tie up the server for about a minute (even though I know the async process takes longer than that and is still processing the request). Even if I try to hit the page in a different browser it still takes a minute to load.

Basically I just want to make the WCF call and forget about it, I don't want users to be waiting while I am doing some heavy processing and calling an external

View 1 Replies

Invoke Asynchronous Method Call From .NET?

Jul 20, 2010

I'm currently working on a web site which involves a data upload process. The file is currently uploaded to the server method is called (in app_code) where ultimately a DTS package is called (via a web method) to load the data into a database and perform some validation on it.The client has specified that they don't want to have to wait for the DTS package to execute (execution time is less than 5 minutes) so it appears that I need to call the method asynchronously. The user will probably logout or close the browser window while this task is running so I believe I'm unable to run this on an asp.net thread.

View 1 Replies

Asynchronous Ajax Call Using QueryString?

Nov 23, 2010

Since i am fresher to .net, i m unable to handle asp.net. I have call asynchronous ajax call using XMLHTTPRequest and also use QueryString to filter Employee details.

I have following files:

1. Default.aspx code

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Task2._Default" %>

<%@ Register TagPrefix="uc1" TagName="SearchResult" Src="SearchResult.ascx" %>

[code]....

3. Ajax.aspx is empty in design

what should be the code in Default.aspx.cs when u take some text in textbox to search, OnClick of "ok" button there should'nt be any postback.

View 1 Replies

WCF / ASMX :: Asynchronous Call To Web Services?

Feb 1, 2011

I'm working on an existing web application (web site project and some class library projects). In the web site project, the guys created many web services, that are called from the aspx pages (sometimes on client side).

I need to create a new web service, so I was suggested to put it "near" the existing web services. I'm gonna need to make an asynchronous call to my new web services.

So I created the service this way, but when I try calling a method asynchronisly, I have only the method in intellisense, I don't have the method for the asynchronous call, neither the Complete event. Why is that ?

On the other hand, I created a new project, with a web service application and a web site where I added the reference to the web service, and this way I have the asynchronous method and the complete event in intellisense.

View 2 Replies

C# - How To Update The .net Page From The Asynchronous WCF Duplex Call

Jul 2, 2010

I've the following doubt. I've a page "MyPage" and i've declared few dictionary objects in the page classMy doubt isIf i declare the dictionary as a private non-static object i'm not able to use it across the functions in that page class (the object is getting nulled)able to across the object across the functions. But will that object be same across all the users who have opened the page right now (guessing that each user will have an instance of the page in turn has an instance for the page class and static variables of a class are invariable across all the instances of the class

View 4 Replies

WCF / ASMX :: How To Get Data From An Asynchronous's Service Call

May 12, 2010

I have an process that take about 15minutes to execute. And i have toput this process in a service, and managed his statWell, i placed this process in a service and in some specific pointi have one variable telling me how much % the process have done.So my service reference im my consumer project its typed to let asynchronous calls.When i start my process with a

[Code]...

View 2 Replies

C# .net Asynchronous Function Call After File Is Uploaded?

Mar 10, 2011

I have a C# asp.net file upload form with a submit button. After the form is submitted the file is uploaded and post-processing is started. The point is that the post-processing can take up to several minutes.I would like to create some kind of asynchronous call of the post-processing function with showing information to the user

View 4 Replies

WCF / ASMX :: Cancel Asynchronous Web Service Call?

Apr 21, 2010

am calling web service method asynchronously using callback method which is long running process.

In mid time in client want to cancel this asynchronous method call then can it be done....??? and if yes then how can it be done..?

View 3 Replies

Make Asynchronous Call In Static Class Function?

May 17, 2010

is it possible to make an asynchronous call to a static class function?

View 3 Replies

.NET, Asynchronous Call To Another Page, Return Response Immediately?

Feb 13, 2010

An external server sends incoming SMS messages converted to HTTP requests into my sometimes very time-consuming .aspx page. If no response is returned to the external server in 20 seconds, this is considered as an timeout and the same message is sent to my aspx page again (and maybe again....The optimal solution for me would be that the aspx page reads the incoming message (as an HTTP request to the aspx page), starts the processing of the message in another thread, and immediately renders response back to the external server. The external server has no interest in other stuff than the HTTP status (normally 200). When the processing of the message is completed this results in an entry into the log file of the application.

View 2 Replies

WCF / ASMX :: How To Asynchronous Call And Waiting For Function To Finish Processing

May 10, 2010

I have to call a function to run a report through a web service, then call another function to get the data but only after the 1st function has finished processing. How do I make c# wait till the first function has finished processing to run the second function?

my code looks something like:

NetworkCredential Cred = new NetworkCredential("uid", "pw");
ReportWebService reportService = new ReportWebService();
reportService.Credentials = Cred;
string s = reportService.runReportAsync("0ede9884e6394daf73fa418e9bffd4fc");
string report = reportService.getReportData(s);

This code will break because s is not set since the function (runreportasynch) has not finished running to produce s.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved