High CPU load after Razor page render completed - asp.net-mvc

I get a weird behavior of Razor - after rendering a web page of approx 300 DIVs, with some user info in each, rendered in a loop, the CPU continues to run at 100% single-core load for about 30 seconds. No IO ops, no change in memory utilization, just burning CPU cycles.
The page is rendering data from the database, 300 records. It's not the database fault - I checked it by disabling DB access, replacing the records with dummy data and obtained the same behavior. The page is rendered and displayed in the browser, no other requests are active, so the server side code (at least my code) is idle.
UPD: The problem ONLY appears when the site is launched from within Visual Studio. Regardless whether it is hosted in IIS Express or IIS. Both running .NET 4.5.1, MVC 5.1.2. Opening the same site when devenv is not running makes the issue disappear.
Could anyone advise - whether you have experienced a similar issue and how you coped with it, and, how could I identify the piece of code that's causing the problem?
SOLVED! It's the Browser Link!
http://blogs.msdn.com/b/webdev/archive/2013/06/28/browser-link-feature-in-visual-studio-preview-2013.aspx
Disabling it solves the issue.

Eventually it all came down to VS Browser Link. (http://blogs.msdn.com/b/webdev/archive/2013/06/28/browser-link-feature-in-visual-studio-preview-2013.aspx)
Happens to be that smaller web pages work just fine, but larger pages cause a disproportionally higher load on the web-server process, making part of the server do something after the page is sent to the browser.
Disabling Browser Link solves the problem.

Related

JxBrowser memory footprint: handling DOM leaks

We are using Vaadin as our back end technology.
Vaadin clients consume browser memory due to DOM leaks.
The memory consumed by the browser eventually leads to performance issues.
Questions:
Is there a way to monitor the Browser instance for memory consummation or performance deterioration?
Is there a way to dynamically restart the Browser instance without impacting the client, or limit the impact on the user experience?
Similar to:
JxBrowser takes huge RAM
At the moment, JxBrowser doesn't provide such functionality.
Well, if we are talking about "restarting" the Browser instance, I can suggest that you just dispose it and create a new Browser instance. It's like closing and opening a new tab in Google Chrome. Af far as I know, at the moment Chromium doesn't provide functionality that allows "restarting" the Browser instance without reloading already loaded web page and destroying session cookies.

Application hangs with Full page heap enabled

My Application crashes while closing a Dialog. I tried to debug the code and could not make any good conclusions from that. I took crash dumps and analyzed using the Debug Diag tool and got the report that it could be a Heap corruption in MSVBVM60.dll.
As a next step, I tried enabling the Full Page heap but my application completely hangs. I am aware that enabling Full page heap would bring down the performance and can make the application not Responsive. This exactly happened with my application as well.
I tried with Normal Page heap, but still did not get any good info.
I tried setting in the Application verifier and also in the GFlags.
I tried for Heap tail and other options but could not really conclude the root cause.
I Tried for the specific image and not the whole machine.
Is it possible to take Full page heap by increasing the RAM of my machine?
Or is there any thing that I can do to get Full page heap? Please suggest.

Visual Studio 2013 started lagging during debuggin ASP .NET MVC 5.1 application

Till yesterday during debugging I could freely modify views and then reload the website in the browser. But know even when I scroll it freezes completely for even 10 seconds. Sometimes works for few seconds without a lag. When I do not scroll CPU usage by VS2013 is almost 0% when I scroll it goes up to 25 and it freezes constantly.
What happenned and what can I do?
any anti-virus software sheduled file system checks? How much RAM installed in your computer? VS2013 minimal requirements is 1GB. Also whith OS do you run? It all sounds like you don't have enought. In my practice when usage of RAM is abount 75-80% VS begin freezes. Or if there is heavy CPU loading in background, caused some hidden processes.
I am experiencing the same thing, it happens randomly. I think the problem with mine is that my laptop is extremely old and couldn't handle the process. When it does happen, closing VS and the browser and then reopen them seems to solve the problem.

TWebbrowser massive memory leaks : no solution so far

I have an application that uses TWebbrowser to periodically navigate to a specific URL and extract some data. The app keeps runing 24x7 and does a lot of navigation in pages.
The problem is that TWebbrowser has a well-known memory leak problem, in which every time you navigate to a new page, the memory used for the application is increased. My app can easily use more than 2GB of RAM after some time. And after navigating hundred of times an 'Out of memory' or 'Out of system resources' exception is thrown and the only way to work around it is restarting the application.
The strange thing is FASTMM never shows these leaks. When I use my app for some minutes and close it, nothing is reported.
I've been searching for a solution for this problem for years (in fact since 2007 when I wrote the first version of my application). There are some workarounds but in fact, none of them solves the problem. For me the only workaround is really to close and open the app periodically.
I already tested the SetProcessWorkingSetSize approach, but it only shrinks the memory used by the app temporarily. After some seconds, the app uses a huge amount of memory again.
I also tried EmbeddedWB, but as it descends from TWebbrowser, it's plagued by the same issue.
By the way, I can't use a simple component like IdHTTP, because I need to do some JavaScript manipulation in the website visited.
Does anyone know if is there REALLY a solution for this problem?
QC#106829 describes one possible cause of memory leaks with TWebBrowser. Accessing Document (and any other properties that are implemented via TOleControl.GetIDispatchProp or TOleControl.GetIUnknownProp) causes leaks because it calls AddRef without ever calling Release. As a workaround, you can manually call Release, or you can patch the VCL (see here), or you can avoid the problematic properties (for example, by using browser.DefaultInterface.Document instead of browser.Document).

PhantomJS.exe massive memory use with Webdriver

I have written a simple scraping program using PhantomJS and webdriver, which essentially consists of the following steps:
Navigate to a page
Collect a number of links (30) from the page by xpath
For each link, navigate to that url and collect a bunch of text elements on the page
I am not calling this in JavaScript, I am using webdriver written in C#.
My issue is that the PhantomJS.exe process reaches memory usage of over 800 MB, which I can't understand why this is happening. My .net exe's memory usage (which calls the PhantomJS.exe) sticks around 12 MB throughout. I'm only using one instance, and running all processing in serial, so effectively one window or 'tab' as far as I am aware.
Has anybody come across similar issues using PhantomJS, any reason it should have this behaviour?

Resources