I've encountered a curiosity that I don't understand.
If I go to the website notalwaysright.com with the EasyPrivacy filter enabled, the throbber continues to spin as long as I visit the site. Not a big deal, but this causes a core of my CPU to spike to 100% utilization which causes severe system lag. How is this possible? How can blocking something on a web site cause my CPU to spike? And of course, leaving the site, all is well again...
I've posted on the EasyList forum because it's their filter, but since I'm extremely curious how this is possible, I posted here as well in hopes Wladimir would have some ideas. (Not about the filter, but how blocking something could cause 100% CPU utilization)
Blocking causes 100% CPU Utilization?
Re: Blocking causes 100% CPU Utilization?
The problem is this part of the page in question:
It enters infinite loop when neither of the two above images can be loaded, see Mozilla bug #494377.
Code: Select all
<img src="http://www3.clustrmaps.com/counter/index2.php?url=http://notalwaysright.com" style="border:0px;"
alt="Locations of visitors to this page" title="Locations of visitors to this page" id="clustrMapsImg"
onError="this.onError=null; this.src='http://www2.clustrmaps.com/images/clustrmaps-back-soon.jpg'; document.getElementById('clustrMapsLink').href='http://www2.clustrmaps.com'" />
Last edited by ziutek on Thu Sep 24, 2009 1:36 pm, edited 2 times in total.
Re: Blocking causes 100% CPU Utilization?
Does going into about:config and setting javascript.options.relimit to "true" help at all?
Re: Blocking causes 100% CPU Utilization?
@ Ziutek Hmmm... Interesting. Very odd behavior. Looking at the filter, AdBlock Plus just sits at counts hits while it's in this loop. Looks like EasyPrivacy needs to be modified.
@ Asdf No, that doesn't seem to make any difference.
@ Asdf No, that doesn't seem to make any difference.
Re: Blocking causes 100% CPU Utilization?
Interestingly, whoever wrote this attempted (unsuccessfully) to prevent the infinite loop by using:
The correct code would be:
Code: Select all
this.onError=null;
Code: Select all
this.removeAttribute('onError');
Re: Blocking causes 100% CPU Utilization?
Due to a tip on the EasyList forum, I've created an exception for http://www2.clustrmaps.com/images/clust ... k-soon.jpg, which solves the CPU usage issue. Hopefully that doesn't negate the point of the filter. (Is the image also used for tracking purposes?)
Apparently the code is supplied by clustrmaps to those pages using the service, as there has been another example of this issue posted on the the EasyList forum with another web developer using the exact same code.
Apparently the code is supplied by clustrmaps to those pages using the service, as there has been another example of this issue posted on the the EasyList forum with another web developer using the exact same code.
Re: Blocking causes 100% CPU Utilization?
There is no reason why it wouldn't be.HeffeD wrote:Is the image also used for tracking purposes?