How to know what site opened in Firefox loads CPU on 90% - performance

Some sites opened in Firefox take 90% of CPU usage.
Is there some diagnostic utility or plugin to know what these sites are?
If site is known, is it possible to know what script, plugin or something else is reason of 90% CPU usage?

There are also many other issues that can cause high CPU usage outside of Firefox itself. I usually find this type of problem has to do with available memory. If you don't have much available memory left, then the CPU usage is caused by the OS thrashing (i.e. moving pages between virtual and real memory). What I do is to kill Firefox / Chrome with the task manager, and then have Firefox / Chrome restore the pages. Then I clean up the number of tabs I have open. Another thing that can cause CPU/memory usage issues are badly designed plug-ins. Disable them and see if you still have an problem.

Related

Is it possible to throttle Intellisense CPU use?

My dev machine is absolutely crawling - programs frequently non-responsive, etc. It turns out VS2019 is maxing out my CPU (80-100%) for minutes at a time even when I'm not using it, and I've identified "Background Tasks" as the culprit, namely Intellisense. This is not simply when loading a solution, but hours later.
Is it possible to control how much CPU resource it is allowed to use? I don't want to turn it off (not sure if it's possible) but are there any settings because it is making my machine almost unusable.

how to find out why the battery is hot

Do you have any ideas for finding out why the phone's battery will be too hot?
I implement the PWA site with React and Firebase (firestore). And I'm running into the above problem. To find out about it, I watch the following tools.
Chrome's memory tab
performance's memory tab
Please tell me other ways to find out why the battery is hot.
There are many reasons why your phone runs hot and we are unable to deduce which is the main cause with the data provided. But, some reasons why your phone runs hot may be old hardware, deteriorated battery, the cpu consumption of your page is too high, there is a lot of data transfers happening in the background and many more. Sometimes it might not be even your page that is causing your phone to run hot.

Strange memory leak on Mac (Chrome, Firefox and Safari) with our GWT based web UI

We are experiencing a serious memory problem in our GWT based web application when running in Mac, for Chrome, Firefox and Safari.
For example, with Firefox, when looking at the Activity Monitor on Mac, the memory consumption is quickly increasing across time, even through frequent refreshes, and can reach 1 GB after a significant session. Similar phenomena happens for Chrome and Safari.
But, we cannot see a real reason using various profiling tools, including Java JProfiler (for GWT) and Chrome profiler and timeline looking at native JS, listeners and DOM elements.
Actually there are 2 related problems here:
The memory is increasing while using the UI for along time without refresh. In this case, we can see some uncollected garbage SVG elements (we are using SVG based canvas) that are unreachable, but the memory increase in the Activity Monitor is much higher than what we would expect with this garbage.
The memory remains high even after multiple refreshes, and even though the profiler shows that all the above garbage is completely gone.
We are chasing this leak for a while, with no results, so I would appreciate any help.
Thanks,
Yaron.
The problem occurs only on Mac?
What GWT version are you using? 2.5?
Did you saw this issue https://code.google.com/p/google-web-toolkit/issues/detail?id=6938?
I faced several issues with leaks using GWT before, but in 2.5 version it works fine, even in IE!
I've tracked down some leaks in my GWT application before, and it's certainly not easy to determine where they're coming from thanks to Java's garbage collector hiding what's going on. The most common reason for a leak would be cyclical references, so multiple objects can't be garbage collected because they reference each other. They're tough to spot on your own so I use a library called FindBugs - it also comes with a very convenient Eclipse plugin. FindBugs literally finds anything you could possibly consider and has worked wonders for me. BUT make sure to play with the settings first; cyclical reference checking is not enabled by default.
Bruno_Ferreira makes a good point, too - make sure you're up to date with your GWT version as they're always improving memory leaks.

What could cause the application as well as the system to slowdown?

I am debugging an application which slows down the system very badly. The application loads a large amount of data (some 1000 files each of half an MB) from the local hard disk.The files are loaded as memory mapped files and are mapped only when needed. This means that at any given point in time the virtual memory usage does not exceed 300 MB.
I also checked the Handle count using handle.exe from sysinternals and found that there are at the most some 8000 odd handles opened. When the data is unloaded it drops to around 400. There are no handle leaks after each load and unload operation.
After 2-3 Load unload cycles, during one load, the system becomes very slow. I checked the virtual memory usage of the application as well as the handle counts at this point and it was well within the limits (VM about 460MB not much fragmentation also, handle counts 3200).
I want how an application could make the system very slow to respond? What other tools can I use to debug this scenario?
Let me be more specific, when i mean system it is entire windows that is slowing down. Task manager itself takes 2 mins to come up and most often requires a hard reboot
The fact that the whole system slows downs is very annoying, it means you can not attach a profiler easily, it also means it would be even difficult to stop the profiling session in order to view the results ( since you said it require a hard reboot ).
The best tool suited for the job in this situation is ETW ( Event Tracing for Windows ), these tools are great, will give you the exact answer you are looking for
Check them out here
http://msdn.microsoft.com/en-us/library/cc305210.aspx
and
http://msdn.microsoft.com/en-us/library/cc305221.aspx
and
http://msdn.microsoft.com/en-us/performance/default.aspx
Hope this works.
Thanks
Tools you can use at this point:
Perfmon
Event Viewer
In my experience, when things happen to a system that prevent Task Manager from popping up, they're usually of the hardware variety -- checking the system event log of Event Viewer is sometimes just full of warnings or errors that some hardware device is timing out.
If Event Viewer doesn't indicate that any kind of loggable hardware error is causing the slowdown, then try Perfmon -- add counters for system objects to track file read, exceptions, context switches etc. per second and see if there's something obvious there.
Frankly the sort of behavior demonstrated is meant to be impossible - by design - for user-mode code to cause. WinNT goes to a lot of effort to insulate applications from each other and prevent rogue applications from making the system unusable. So my suspicion is some kind of hardware fault is to blame. Is there any chance you can simply run the same test on a different PC?
If you don't have profilers, you may have to do the same work by hand...
Have you tried commenting out all read/write operations, just to check whether the slow down disappears ?
"Divide and conquer" strategies will help you find where the problem lies.
If you run it under an IDE, run it until it gets real slow, then hit the "pause" button. You will catch it in the act of doing whatever takes so much time.
You use tools like "IBM Rational Quantify" or "Intel VTune" to detect performance issue.
[EDIT]
Like BenoƮt did, one good mean is measuring tasks time to identify which is eating cpu.
But remember, as you are working with many files, is likely to be missing that causes the memory to disk swap.
when task manager is taking 2 minutes to come up, are you getting a lot of disk activity? or is it cpu-bound?
I would try process explorer from sysinternals. When your system is in the slowed-down state, and you try running, say, notepad, pay attention to page fault deltas.
Windows is very greedy about caching file data. I would try removing file I/O as someone suggested, and also making sure you close the file mapping as soon as you are done with a file.
I/O is probably causing your slowdown,especially if your files are on the same disk as the OS. Another way to test that would be to move your files to another disk and see if that alleviates the problem.

Firefox plugin CPU usage

I need to collect data on firefox CPU usage during web-development coding session and I'm wondering if it is possible to monitor CPU usage of particular firefox plugin.
Right now i'm using windows' perfmon.msc, but it will only allow me to monitor firefox process as a whole.
Do you know any tools that would allow me to get CPU data from a plugin? Is it possible at all ?
You could analyze the CPU usage using Process Explorer. Right-click on the Firefox process and select properties. On the Threads tab you will see the different threads including add-ins such as Flash or Acrobat with their CPU usage listed.
EDIT: In fact, it should be possible to monitor threads with perfmon, too: Right-click to select Add Counters... and then choose Threads as performance object.
I'd guess your best option would be to test your plugin in a seperate Firefox process, but you're probably doing that anyway.
For real profiling you should use Firebug. I'm not sure about it, but I think it is possible to run XUL apps inside of Firefox (without integrating it as a plugin). If this is not an option then you could maybe separate out code that you suspect to be slow into a web page and profile it with Firebug. This would of course only work for stuff that is not interacting with the Mozilla core.
Actually Firefox does have a built-in "Task-Manager" for a few years now. Just type about:performance in the URL. It shows Name, Type, Energy Impact and Memory of each tab and add-on.
If you want to dig deeper Shift + F5 opens the performance tool where you can record e. g. opening a website and look into timings etc.
There are some JS profilers which also profile extension JS, however they don't really help on finding problematic addons.
There was a feature on the concept design of Firefox 4, however it's dumped as FX4 is feature-frozen now. But I'm still after that feature and wish to follow any progress in that direction.
Here is a question to find more about it;
https://superuser.com/q/218733/46962
For CPU utilization, you can collect the data using MS Perfmon, which is a part of Windows, and also used for similar purposes, like collecting CPU performance & stats data on SQL server for optimization.
Now in Firefox 94 there are such tools:
about:performance can show you CPU (Energy Impact) and Memory usage for all tabs and addons.
about:memory will allow you to make recordings of processes' resource usage statistics, then you can filter it knowing CPU-hungry process id, which you get from htop or top command. In the recorded snapshot you'll see extensions and their unique ids and can use it to identify and remove the extension.

Resources