Firefox hangs and uses 50% CPU on exit

Discussions and Tech Support specific to the iMacros Firefox Add-on.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Jehy
Posts: 4
Joined: Mon Oct 26, 2009 2:25 am
Contact:

Firefox hangs and uses 50% CPU on exit

Post by Jehy » Mon Oct 26, 2009 2:47 am

Hello. I've got a rather typical problem: when I close Firefox, main window disappears but the process stays in memory, it consumes ~200 MB of memory and 50% CPU (it means, 100% of one core in case of my dual core processor).

I tried disabling all extensions step-by-step, and was very surprised when I found out that without imacros everything works fine. (Also, the same crash happens if I disable all extensions but imacros)

I hope there's a way to solve the problem because I like using imacros and don't want to disable it.

I am using Firefox 3.5.3, with all extensions of the last stable versions...
List of my extensions ("__" means "disabled"):

AdblockPlusElementHidingHelper{1.0.6}.xpi
AdblockPlus{1.1.1}.xpi
AddtoSearchBar{1.8}.xpi
__ CLEO{4.3}.xpi
CheckBoxMate{0.2}.xpi
__ CompactMenu2{2.3.2}.xpi
__ DownThemAll{1.1.6}.xpi
__ DownloadHelper{4.6.4}.xpi
DownloadStatusbar{0.9.6.5}.xpi
__ FEBE{6.3}.xpi
FileTitle{1.3}.xpi
Firebug{1.4.3}.xpi
Flashblock{1.5.11.2}.xpi
__ FoxyProxy{2.14}.xpi
GoogleToolbarforFirefox{5.0.20090813W}.xpi
IETab{1.5.20090525}.xpi
LazarusFormRecovery{2.0.4}.xpi
__ OrganizeSearchEngines{1.5}.xpi
QuickImage{1.0}.xpi
QuickRestart{1.1.5}.xpi
Russianspellcheckingdictionary{0.4.3}.xpi
SessionManager{0.6.6.2}.xpi
ShortenURL{0.3.0.1}.xpi
TreeStyleTab{0.8.2009090201}.xpi
UndoClosedTabsButton{3.5.1}.xpi
UpdateNotifier{0.1.5.5}.xpi
UserAgentSwitcher{0.7.2}.xpi
ViewCookies{1.9}.xpi
WebmasterSAPE{1.24.3}.xpi
Xmarks{3.3.2}.xpi
iMacrosforFirefox{6.2.4.0}.xpi
Hannes, Tech Support

Re: Firefox hangs and uses 50% CPU on exit

Post by Hannes, Tech Support » Mon Oct 26, 2009 10:42 am

Thanks for reporting. I will tell the developers about it.

Is that behavior affected by a macro currently running while you close the browser?
Jehy
Posts: 4
Joined: Mon Oct 26, 2009 2:25 am
Contact:

Re: Firefox hangs and uses 50% CPU on exit

Post by Jehy » Mon Oct 26, 2009 11:01 am

Thank you very much.

No, no macros are running.
User avatar
Tech Support
Posts: 4948
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Re: Firefox hangs and uses 50% CPU on exit

Post by Tech Support » Fri Oct 30, 2009 10:39 pm

Does this issue happen "only" on one PC? We can not recreate it here.
Jehy
Posts: 4
Joined: Mon Oct 26, 2009 2:25 am
Contact:

Re: Firefox hangs and uses 50% CPU on exit

Post by Jehy » Sun Nov 01, 2009 5:49 pm

I have only one PC, can't check on others...

Anyway, it's not only my problem.
It's really diffucult for user to detect that imacros is at fault, so they don't report it.

In the first minute of googling, I found a message which described the same problem. Seems like it is profile related.

May be, on firefox exit Imacros tries to read/write smth from/to profile, but the profile is buggy, and Imacros fails to do it and makes infinite loops.

Here's the message at the link above:
Thanks. Yes, this is profile related. As follows.

1. Attempting to backup (COPY) the current profile folder (162 folders 33 files) resulted in: when firefox still active - hangs with message about place.sqlite-.... being used (copy has 24 folders 0 files) after exiting firefox but with the firefox.exe process still around - hangs with message about places.sqlite-journal being used (copy has 57 folders 0 files) firefox.exe process killed - successfully backed up (COPYied) folder (copy has 162 folders 33 files)

2. Then I exported my bookmarks to an html file, and deleted every piece of the bookmarks I was able to. But error behaviour continued (firefox.exe remains around)

3. created new profile per your directions and started firefox with it. No problems - was able to exit and restart firefox normally. But when tools/addons/extensions "Google Toolbar for Firefox 3.0.20070420W" was still there, with all its buttons (options/enable/ uninstall) grayed out. It was the only extension there, which I assume to be normal. So why and where is the toolbar hanging on from, even with a new profie?

4. Imported bookmarks from html file saved in (2) and cleaned up to get rid of duplicate toolbar folder etc. New profile still works fine during exit/start

5. installed add-ons, one by one, restarting between each - adblockplus,noscript,screegrab,dictionary search,answers,imacros. restarted each time. Then tried an Exit from Firefox and found that the problem was BACK. So I tried uninstalling add-ons in reverse order. "imacros for Firefox" or a specific imacro seems to be the one hurting me since as soon as I uninstalled it, exit and restart worked fine
darkAsPitch
Posts: 25
Joined: Mon Oct 19, 2009 4:02 pm

Re: Firefox hangs and uses 50% CPU on exit

Post by darkAsPitch » Mon Nov 09, 2009 8:18 am

I notice the 50% cpu closing problem as well...

Running the latest version of firefox (I check for updates once per day..)
- my firefox installation is portable however

Running your latest (non beta) version of iMacros:
VERSION BUILD=6240709 RECORDER=FX

When I shut down firefox, and attemps to re-open it, I will be told that firefox is already running.. and the only thing I can do is enter task manager and disable it manually..
darkAsPitch
Posts: 25
Joined: Mon Oct 19, 2009 4:02 pm

Re: Firefox hangs and uses 50% CPU on exit

Post by darkAsPitch » Thu Nov 12, 2009 7:14 am

This has become increasingly more annoying...

so I'll post a bit more about it!!

I am using javascript to call multiple imacros in a certain order. If a mistake is made, or the macros report an error, javascript will call another macro, in an endless loop...

So the first weird thing I've noticed.. is that when I'm trying to close/cancel my endless loop.. I shut down imacros, which warns me that the javascript will be stopped as well (which is exactly what I want) but that DOES NOT seem to happen..?

ie. when I close my iMacros extension, the macros keep playing themselves (according to the javascript) as if iMacros were still working... then when I shut down firefox alltogether my CPU/fan speeds right up and I have to go into task manager to disable it...

It's a shame I have to constantly edit my javascript loop between the "testing" and actual "running" of it... lest firefox go on a CPU eating rampage.. :(
josephconlin
Posts: 190
Joined: Wed Aug 06, 2008 2:38 am

Re: Firefox hangs and uses 50% CPU on exit

Post by josephconlin » Thu Nov 12, 2009 4:51 pm

darkAsPitch wrote: I am using javascript to call multiple imacros in a certain order. If a mistake is made, or the macros report an error, javascript will call another macro, in an endless loop...
I wondered if that was the case, but earlier the original poster had said no macros were running so I assumed that this would happen even if you started Firefox fresh, and without doing anything else, let it sit for 5 seconds and close it again. If that works, but after running your javascript macros, it doesn't work, then you are seeing exactly what I see.

iMacros doesn't ACTUALLY stop the javascript from executing if you have an endless loop. Stop, pause, shutting down the browser, etc, none of those things stop the endless loop.

Therefore, my workaround is to never create an endless loop. I always write my loops in such a way that, if it WERE to get into an endless loop, I also put some sort of counter on it to stop it after a while.

For example, instead of something like

Code: Select all

while(extractedValue != "#EANF#")
{ //do stuff
}
I do something like

Code: Select all

var loopstop = 0;
while(extractedValue != "#EANF" && loopstop < 1000)
{ //do stuff
loopstop++;
}
This means that you can't let something sit and run forever, but truth be told, you wouldn't REALLY ever want to do that. Why? Because your OS (especially if it's Windows) or Firefox (no matter what OS you run on) will, over time, leak memory, slowing down your computer until it crashes.

If you need something that will run "forever", you would do well to set it up so that it runs for "nearly forever" with a way to stop the loop eventually, and then checking on your system on a regular basis, whether that be hourly, daily, weekly, whatever.

Hope this helps.
User avatar
Tech Support
Posts: 4948
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Re: Firefox hangs and uses 50% CPU on exit

Post by Tech Support » Sat Nov 14, 2009 12:35 am

Just to clarify: Is this issue now Javascript related?

Or: Does anyone think he can recreate the issue on one our test machines? If yes, please email support AT iopus.com and we can give you remote access to an XP, Vista , Win 7 or whatever you need test machine. If you can recreate the issue there, we can debug and fix it in a few days.
SorenC
Posts: 36
Joined: Wed Oct 28, 2009 4:33 pm

Re: Firefox hangs and uses 50% CPU on exit

Post by SorenC » Sat Nov 14, 2009 1:06 pm

A little suggestion, that i think would work.

When most people close down FireFox, they use the red X in the top right corner. Which does not exactly close FireFox down right away.

Instead use:

Code: Select all

File >> Exit
That will in most cases, close FireFox and stop anything running in it. It has worked for me many times, where i've used the red X to close FF down with.

Not sure if it works for you guys, but as i said. Just a suggestion. =)
Jehy
Posts: 4
Joined: Mon Oct 26, 2009 2:25 am
Contact:

Re: Firefox hangs and uses 50% CPU on exit

Post by Jehy » Sun Nov 15, 2009 9:12 pm

Tech Support wrote:Just to clarify: Is this issue now Javascript related?

Or: Does anyone think he can recreate the issue on one our test machines? If yes, please email support AT iopus.com and we can give you remote access to an XP, Vista , Win 7 or whatever you need test machine. If you can recreate the issue there, we can debug and fix it in a few days.
1) No, it is not. No javascript runs when I close firefox.

2) I don't think I'll be able to. I think, it depends on some individual firefox's profile bugs. May be, I'll be able to send you Imacros save data, and the bug will be reproduced...
I send you data from my profile folder in attachment. You don't need to run any of those macroses.
Attachments
iMacros.zip
(15.89 KiB) Downloaded 104 times
beware77
Posts: 1
Joined: Wed Nov 18, 2009 8:06 am

Re: Firefox hangs and uses 50% CPU on exit

Post by beware77 » Wed Nov 18, 2009 8:16 am

Hello,
I confirm this bug. Symptoms are the same, disabling iMacros add-in solves the problem.
SorenC
Posts: 36
Joined: Wed Oct 28, 2009 4:33 pm

Re: Firefox hangs and uses 50% CPU on exit

Post by SorenC » Thu Nov 19, 2009 8:26 am

I'm running firefox + Imacros (latest version) on both of my servers along with my home desktop and laptop.

I havent been able to reproduce the same error/hangtime that some other users has been experiencing.

Would be good to see, if IOpus could reproduce the hangtime.
giorgio79
Posts: 80
Joined: Thu Oct 02, 2008 8:34 am

Re: Firefox hangs and uses 50% CPU on exit

Post by giorgio79 » Tue Jan 05, 2010 2:00 pm

This issue could be a duplicate of this thread describing a possible imacros FF memory leak, with steps to reproduce towards the end.

http://forum.imacros.net/viewtopic.php?f=11&t=5664


This issue is limiting me as well unfortunately.
Share your imacros easily http://www.sharemacro.com/imacro-directory
Internet Marketing imacros http://www.sharemacro.com
L_O_U_S
Posts: 1
Joined: Thu Jan 07, 2010 8:58 pm

Re: Firefox hangs and uses 50% CPU on exit

Post by L_O_U_S » Thu Jan 07, 2010 9:03 pm

Hello,

I experienced it, too. It happened on my machine with Vista some time ago and I fixed it by disabling "Comodo Safe Surf" or how the hell is that called. I noticed the same problem today on my laptop (Windows 7 installed). I don't have Comodo firewall yet, so the problem must be somewhere else. Norton Security, perhaps?
Post Reply