There is the excellent Start Profiling button in the SCM portal that works perfect for CPU.
Then there are some sources that refer to a Download GC Dump button:
https://stackoverflow.com/a/27987593/647845
But that doesn't seem to be available anymore.
Then there is the Download memory dump button.
But for now I can't figure out how/if I can see the Type / Refcount / Size stastistics that I'm used too.
What is the recommended way to look for memory leaks in a C# Azure Web App?
Unfortunately the kudu support page has been deprecated. You can now find it under Diagnose and solve problems:
Once you've downloaded the dump files, open them in Visual Studio and click "Collect a memory dump" like the accepted answer from Grandhali suggested.
Try using Kudu console.
Go to https://[sitename].scm.azurewebsites.net/support
Click Analyze -> Dignostics -> Settings. Make sure Memory dumps is checked
And then Click Dignose Now.
This will work only in Basic plan and above (Not available for free plan)
After some time you will get the dump
Open the downloaded file with Visual studio and select "Debug managed memory".
You can then see the details.
I see this thread is pretty old, but since I had the same problem and the azure portal changes a lot during the time I want to post a little update here.
This microsoft dev blog gives a fast overview about the topic: https://devblogs.microsoft.com/premier-developer/collect-and-automate-diagnostic-actions-with-azure-app-services/
I managed to do the memory leak analysis by navigating to my App Service in Azure portal, selecting Diagnose and solve problems and afterwards the Diagnostic Tools tile. Now you should see a Collect Memory Dump tile where you can create your memory dump by configuring a blob storage to save it to.
Afterwards I downloaded the dumps and used Visual Studio to analyze the issues.
You can download a memory dump using Kudu Console and use DebugDiag to profile it, you can have more than one memory dump, one before the leak happens, one during it and one after, later you can compare and see which objects are growing in size and not getting disposed
Remote Profiling the Azure Web App from Visual Studio is probably the best option.
https://azure.microsoft.com/en-us/blog/remote-profiling-support-in-azure-app-service/
Related
So where can one find the local logs for when debugging a Azure Function locally with Visual Studio 2019?
Relevent documentation:
https://learn.microsoft.com/en-us/azure/azure-functions/streaming-logs
The Azure Function documentation only explains this for VS Code, but for this project I need VS 2019, and they are not where I would expect to find them (in the Output window under the Debug dropdown).
They can be seen on the deployed function fine in the Streaming logs, so they are getting created, but for development speed I need them locally too.
I have been looking and googling for a day or two now, so I am reluctantly resorting to Stack Overflow. They must be there somewhere, right?
The logs should also appear in the console window when you start your project.
Ok, the problem was I was using information level messages and they don't come to the console by default. There were some messages on the console, but I had no idea they were actually log messages, thanks to Justin for putting me on to this.
More googling revealed you need to specify an additional argument on startup to see those messages - in Visual Studio on the Properties dialog for the function app Project - a screenshot of that dialog:
My hard drive is at 100% in Task Manager.
I disabled Windows Search and Superfetch and hard drive is still at 100%.
I am using Windows 10.
Any suggestions would be helpful.
Update: Task Manager won't show what process is clogging up hard drive at 100%.
Task Manager won't show any processes that use up a lot of percentage of hard drive.
I suggest you see the processes tab and see if any process that might be using maximum read/writes in your hard drive.
Disable Indexing service that sometimes use more resources. Disable any startup process that might be using your system resources.
Windows + R -> Run Menu -> Type: msconfig and see any startup process that you can disable. Disable any program that seems suspicious.
You can try some other repair methods like:
Perform a diskcheck
Reset Virtual Memory
Disable Antivirus Software temporarily
Change the settings in Google & Skype
Fix your StorAHCI.sys driver
Update your device drivers
Win10 100% disk usage
I had the same issue on my WINDOWS 10 system and I tried a lot of things like turning off the search indexing feature of windows but nothing worked using all that. Here is what worked for me. I opened the task manager and found that there was a task with Microsoft Compatibility Telemetry (CompatTelRunner.exe). It is a Windows process that is designed to collect and send usage and performance data to Microsoft. The executable file collects and regularly sends usage and performance information to Microsoft in order to analyze the user experience and improve it. The described file also helps Microsoft to identify compatibility issues and ensure compatibility when installing the latest Windows OS version. However, Microsoft Compatibility Telemetry eats CPU by scanning computer files and check their compatibility with Windows 10 in case an update is initiated.
I simply clicked on End Task for Microsoft Compatibility Telemetry and my disk usage went from 98% to 15% within few seconds. I hope it helps others experiencing the same issue as well.
I had the same issue with windows 10 on Laptop.
I set the windows update service from automatic to manual.
Now i am always under 5%.
Click on administrative tools in control panel
Then click on Services
set windows update to manual.
Had the same problem for months. Desactivated SrTasks.exe and it started working.
However this task is clearly something important, so I think it's not recommanded to stop it.
My current project uses Visual Studio 2010 and TOAD. It is an MVC project with Oracle 11g. I can get the SQL I am producing with logging and or debugging, however, since I already have a TOAD license I would love to be able to use the Tools for Oracle product, SQL Tracker to get the SQL in runtime without having to use logging or break points.
I assume I need to use the devenv.exe (VS executable) process but I cannot get it to add to the SQL Tracker tool. I get the error:
cannot create process; error=[740] (the requested operation requires elevation.)
Any google search says it has to do with running as admin. I have tried to include the Command-line argument of "RUNAS Administrator" (as well as a variety of other options) with no luck.
Update:
I am now able to Start monitoring the devenv.exe process. In order to do this I needed to run the applications as administrator before I even started SQL Tracker. However, no output is being captured.
I think I probably need to monitor the IIS process instead (w3wp.exe). When I click to start monitoring this process I now get the error:
Failed to create remote thread; error=8 (Not enough storage is available to process this command.)
I believe monitoring IIS is the correct approach, however, this error is now holding me up. Again google is not helping and I am running everything as Administrator.
Root cause could be many reasons but one thing that I suspect is caching on IIS. You can start from looking there.
Here are few things that you can try out.
http://forums.iis.net/t/1150494.aspx?w3wp+exe+memory+usage+is+out+of+control
Running Studio as admin will not necessarily run your project as admin too, imagine the security hole. I am fairly confident you can make your project run as administrator by modifying the manifest. There is an article on here at Forcing an application to Admin from config file but no one ever confirmed whether the answer was right or not, but that does not mean its not. I have noticed on a number of occasions a C# answer gets preference over a VB.NET one on stackoverflow.
I'm really loosing it here. Not being able to attach a debugger to a process is kind of a big deal for me. As such, I'm having a very hard time doing something to pinpoint the source of problems with an Azure-hosted application.
What's worse is that the app works fine in the Development Fabric, even when using online Storage Tables, but can go quite haywire when uploaded and running online.
I know IntelliTrace is one way to do it, but unfortunately, I've got a x86 machine, and the application uses RIA Services. As such, publishing it from my machine results in an error caused by RIA services. I can't build the application by specifying x64 the very same bug strikes again. (So far the only way that I know of to deploy a RIA Services Azure application is to set it to Any CPU and build / publish it from an x64 machine).
So IntelliTrace is not available. Online Azure doesn't have something to resemble the nice console log window of the Development Fabric, and as such, I'm at a loss. Thus far I've been just trying to get things to work and not crash by commenting out sections of code, but given the time it takes to upload and start an instance, this is hardly optimal.
Any suggestions would be appreciated at this point.
The Azure SDK has a logging / diagnostics mechanism built in:
http://msdn.microsoft.com/en-us/library/gg433120.aspx.
One route would be to deploy a version with some Azure specific instrumentation built in.
You could try to RDP into an instance of the role and see if there's anything in any of the logs (event or files) that helps you identify where the failure is.
Baring that, I think Amasuriel has it right in that you REALLY need to architect instrumentation into your solutions. Its something that's on my "must" list when building a Windows Azure application.
If you have access to another workstation with an x64 version of Visual Studio, you can configure Azure diagnostics to collect and copy the crash dumps to Blob Storage:
// Must be called after diagnostic monitor starts.
CrashDumps.EnableCollection(false);
You can then download them (using a tool like Azure Storage Explorer) and debug them locally.
If you absolutely need to see what's going on on the console Rob Blackwell has embedded a neat little trick in his Azure Run Me solution.
It pushes the console output of azure instance(s) out over the service bus. You can therefore consume that data locally and in effect monitor the console of the instances running on Azure right on your desktop.
AzureRunMe is available here and it's open source so you can take a look at how they've fed the console output to the SB.
https://github.com/RobBlackwell/AzureRunMe
I am getting very annoying message called "system.outofmemory.exception" while I do have a lot of unused memory in my laptop. Unless I closed and re-opened the solution, it won't letting me to continue my work.
Is there any configuration or service pack that can fix the issue ?
Thanks
My Solution was was fine in the Visual Studio environment.
But when I was trying to execute tha builded project I was getting System.OutOfMemoryException
After few hours I change the my Comodo Antivirus Settings. I made the builded solution as trusted file.
After that I did not have this problem any more.
Maybe it help you... too
Try reinstalling VS and run a memory check. If there's any update that is able to correct an issue like this, it's maked as important on Microsoft Update, so be sure to run it and select all the updates marked as important. Also, check if running VS as administrator solves the problem, sometimes a normal user has some limitations (on business' networks it's possible that the IT limits memory usage by program, and windows 7 has some new security policies that I'm not sure how they work yet but running a program like adminitrator usually solves the problem).
I have this issue on a daily basis on a WinXP with 4GB of RAM (only 3 utilized, obv). As soon as VS 2010 Ultimate closes onto 700 MB of memory usage, I start getting OutOfMemoryExceptions. Only redemption is to restart VS, even if I close other memory-consuming applications. I also notice that the problem sufaces faster if I run unit tests. Probably because this is a memory-intensive task.
I see two separate issues here.
Visual Studio reporting out of memory when there really is available memory in the OS.
Visual Studio goes into a malfunctional state after the exception, unable to acquire new memory freed by the OS.
1) may be OS-related and not VS, I don't know enough about memory handling in Windows XP to be sure about this. I belive 2) is a VS-problem and should be fixed.
VS reinstallation is temporary solution. Jus increase your machine Virtual memory size. this resolves this issue.
ref below link -
http://windows.microsoft.com/en-in/windows/change-virtual-memory-size#1TC=windows-7