I have application web based net 1.1 Every three or four hour I have the restart my iis server because the performance becomes so slow , nothing will function with message memory leak. I traced the problem to the w3wp.exe in windows server 2003, Using the task manager, I can watch as memory is being added to this exe each time I open or refresh my web pages, but I never see memory released. Eventually there will be so much memory consumed, the web server will slow right down to nothing with display error memory leak and other message.
I don't know about solve that, I needed for monitoring memory used w3wp.exe so I can to release memory normal.
This Message
Server Error in '/myserver' Application.
Exception of type System.OutOfMemoryException was thrown.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.OutOfMemoryException: Exception of type System.OutOfMemoryException was thrown.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[OutOfMemoryException: Exception of type System.OutOfMemoryException was thrown.]
Version Information: Microsoft .NET Framework Version:1.1.4322.2443; ASP.NET Version:1.1.4322.2470
Unfortunately, it isn't likely to be the w3wp.exe process itself, but the assemblies that it loads to run your application. I would check through your source code and make sure that you are releasing unmanaged resources, closing connections and disposing of IDisposable types.
Related
Let me try to describe the situation..
Site A:
Is meant is an catch all site, with only 1 library. This is used by an third party software, that send all the items to 1 location with specified information. Behind this is an timerjob, that sends all the items to their respective sites/libraries. (so doesn't stay on Site A)
Site X:
When an new item is added through the timerjob on Site A. An workflow is started, however the workflow is randomly sunspended with a the same error. A manual start on the same item will allways succeed. Thus only the autostart that gets suspended.
Workflow is made in visual studio and is widely used in the application without problems.
The error message:
Details: An unhandled exception occurred during the execution of the
workflow instance. Exception details: System.ApplicationException:
HTTP 401 {"error_description":"The server was unable to process the
request due to an internal error. For more information about the
error, either turn on IncludeExceptionDetailInFaults (either from
ServiceBehaviorAttribute or from the configuration
behavior) on the server in order to send the exception information
back to the client, or turn on tracing as per the Microsoft .NET
Framework SDK documentation and inspect the server trace logs."}
{"x-ms-diagnostics":["3001000;reason=\"There has been an error
authenticating the
request.\";category=\"invalid_client\""],"SPRequestGuid":["c0fb74e8-6b48-0deb-85c4-7fdab324d2f7"],"request-id":["c0fb74e8-6b48-0deb-85c4-7fdab324d2f7"],"X-FRAME-OPTIONS":["SAMEORIGIN"],"SPRequestDuration":["17"],"SPIisLatency":["0"],"Server":["Microsoft-IIS/8.5"],"WWW-Authenticate":["Bearer
realm=\"97b27fa4-494a-4bff-a6a0-00b798335a86\",client_id=\"00000003-0000-0ff1-ce00-000000000000\",trusted_issuers=\"00000005-0000-0000-c000-000000000000#*,00000003-0000-0ff1-ce00-000000000000#97b27fa4-494a-4bff-a6a0-00b798335a86\"","Negotiate","NTLM"],"X-Powered-By":["ASP.NET"],"MicrosoftSharePointTeamServices":["15.0.0.4687"],"X-Content-Type-Options":["nosniff"],"X-MS-InvokeApp":["1;
RequireReadOnly"],"Date":["Mon, 14 Jan 2019 13:47:12 GMT"]} at
Microsoft.Activities.Hosting.Runtime.Subroutine.SubroutineChild.Execute(CodeActivityContext
context) at
System.Activities.CodeActivity.InternalExecute(ActivityInstance
instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at
System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor
executor, BookmarkManager bookmarkManager, Location resultLocation)
Tried many given solutions (User Sync (however manual start with the same user is not a problem)), Workflow App Permissions feature ..
I am logging the connection status events with the wcf relay, and I'm seeing something like this in the logs.
1/26 06:47:12 ERROR Service Bus ConnectionStatus: 'Reconnecting' Event. [(null)][42]
LastError: System.ServiceModel.CommunicationException: Exception of type 'System.ServiceModel.CommunicationException' was thrown. ---> Microsoft.ServiceBus.Messaging.Amqp.AmqpException: An AMQP error occurred (condition='amqp:unauthorized-access').
--- End of inner exception stack trace ---
This exception doesn't show up in the list on this microsoft page, and the only other post I can find anywhere related to this error message is here. However, that post does not have any recent comments or a resolution or workaround for the issue. Also, the exception doesn't have any stacktrace, so how am I supposed to troubleshoot this error?
I guess as a follow-up, I would ask whether this is anything to actually worry about if the wcf connection is never faulting.
Apparently, the token that the relay keeps refreshing to stay active requires the time on the server to match the azure service that it is connecting with, and if not, this type of error will show up. We were able to fix it by correcting the server time.
I run .exe through windows service which reads the message from Private Queue. The service is all good and stable but at times the service stops (it actually does not stop, but it is not processing anything. Service status is still "Started", I need to manually restart it).
This one doesn't show up often but analyzing the memory dump of the .exe file, I found that so many threads encountered below exception.
Exception object: 0000000001436120
Exception type: System.Messaging.MessageQueueException
Message: External component has
thrown an exception.
System.Messaging.MessageQueueException- External component has thrown an exception
System.Messaging.MessageQueue.ReceiveCurrent(System.TimeSpan, Int32, System.Messaging.Interop.CursorHandle, System.Messaging.MessagePropertyFilter, System.Messaging.MessageQueueTransaction, System.Messaging.MessageQueueTransactionType)
System.Messaging.MessageQueue.Peek(System.TimeSpan)
Any idea why service encounters this exception?? Thanks in advance
I have an windows service that runs 24*7. This service use Renci.SshNet (third party dll) to connect to sftp server and downloading and uploading the files.
I got following information in event viewer. I check the log files and found that when this error come, the code was not running related to SFTP server.
I have written all the code in try catch block, so every error is logged into the log files.
Due to this error, windows service stopped.
I want to know the root cause of this issue and how I can modify the code so my service never get stopped again automatically.
Log Name: Application
Source: .NET Runtime
Date: 5/12/2012 10:49:12 AM
Event ID: 1026
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: FedEx-EDI-01
Description:
Application: Ess.SupplyChainService.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Net.Sockets.SocketException
Stack:
at Renci.SshNet.Session.WaitHandle(System.Threading.WaitHandle)
at Renci.SshNet.Channels.Channel.Dispose(Boolean)
at Renci.SshNet.Channels.ChannelSession.Dispose(Boolean)
at Renci.SshNet.Channels.Channel.Dispose()
at Renci.SshNet.Sftp.SubsystemSession.Dispose(Boolean)
at Renci.SshNet.Sftp.SftpSession.Dispose(Boolean)
at Renci.SshNet.Sftp.SubsystemSession.Finalize()
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name=".NET Runtime" />
<EventID Qualifiers="0">1026</EventID>
<Level>2</Level>
<Task>0</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2012-05-12T14:49:12.000Z" />
<EventRecordID>3723</EventRecordID>
<Channel>Application</Channel>
<Computer>FedEx-EDI-01</Computer>
<Security />
</System>
<EventData>
<Data>Application: Ess.SupplyChainService.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Net.Sockets.SocketException
Stack:
at Renci.SshNet.Session.WaitHandle(System.Threading.WaitHandle)
at Renci.SshNet.Channels.Channel.Dispose(Boolean)
at Renci.SshNet.Channels.ChannelSession.Dispose(Boolean)
at Renci.SshNet.Channels.Channel.Dispose()
at Renci.SshNet.Sftp.SubsystemSession.Dispose(Boolean)
at Renci.SshNet.Sftp.SftpSession.Dispose(Boolean)
at Renci.SshNet.Sftp.SubsystemSession.Finalize()
</Data>
</EventData>
</Event>
You got a socket exception there - the stack trace you posted doesn't contain enough information as to why this happened.
Since the exception was not handled, the process terminated and of course the service stopped as result.
You need to find out why the exception occurred - add more logging and try to capture the incoming socket data.
An unhanded exception will bring your process down.
One answer is to handle the exception, but:
Just handling an exception does not ensure that the process is in a good state.
There is a small set of exceptions (eg. StackOverflowException) that cannot be caught: there is no way for a process to reliably return to a known state.
Alternatively:
Configure the service (via Services.msc) to restart on error,
Configure a tool like adplus (from Debugging Tools for Windows) to take a process dump on failure.
Uses those process dumps to fix the underlying errors.
According to the stack trace you provided, exception raised in finalization thread due to garbage collection (see "at Renci.SshNet.Sftp.SubsystemSession.Finalize" line in stack trace).
Because you can't catch this exception, it becomes unhanded and stops your process.
And that's why "the code was not running related to SFTP server".
Also, if you look at the stack trace more attentively, there's "at Renci.SshNet.Channels.Channel.Dispose()" line. This line means, that 3rd-party library developer trying to release managed resources during finalization. There are very little cases, when this is useful. But, in the same time, it is very dangerous and error-prone.
You should contact library developers.
As a temporary workaround you can setup service restart.
Windows services stops to work as any other app if there is unhandled exceptions, that is your case. Try to debug the code ( having the service running as a console application is my strategy, but you can use attach to process as well ) to check why the exception happens, and handle it properly: a service should recover in some reliable way, the restart on error option and friends should be used just as extreme solution, for instance if you don't own the code.
I've got a .NET application that uses Remoting between an Administration Console and a Server application.
During a particularly long running remoting call, I will get an error message, displayed below.
I have added the Sponsor to the client to prevent the Remoting connection from being closed, and I have verified the Renew() method is being called.
I've googled the error, but nothing much comes up. I'm not really sure what's the issue here, so any help is appreciated.
Value cannot be null.
Parameter name: returnHeaders
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: returnHeaders
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentNullException: Value cannot be null.
Parameter name: returnHeaders]
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +7596735
Well, having a look at the Shared Source found on syncfusion.com, and checking the SecurityPermissions attribute here, and I can guess that either the BinaryFormatter (you did not say which?) failed to de-serialize the object in question.
Since you mentioned that it is particularly a long call, it might be worth your while to wrap up the remoting call in a try/catch block and enclose a full stack to see exactly where it is failing...even better, if the InnerException is not null, include that.... Or do something like this...Ok, it may sound hackish... and may fail...
On the server side, create a dummy method...for instance
void FuBar(void){
int foo = 3, bar = 4, baz = 0;
baz = foo + bar;
}
When you call the long running procedure, spawn a thread in the background to repetitively call the FuBar method to ensure that the remoting server does not expire and when the call finishes, kill off the thread...
My guess, is that after a period of time, the remoting call fails, despite renewing the sponsor...
Or it could be the socket is timing out? I'm out of ideas...
Hope this helps,
Best regards,
Tom.