- It's not JavaScript; it's the fact that there are many complex Scalable Vector Graphics (SVG) files being rendered by the link you posted.
- Fedora's hardware-accelerated graphics stack is notoriously buggy, so it is quite possible that Firefox's use of the graphics stack is causing a bug in the graphics stack (in Mesa, the Xorg DDX, or the kernel).
- It is also possible that the SVGs are being rendered actually in software and the software renderer is still buggy.
Let's divide and conquer:
Disable Hardware Acceleration
In FF, go to Edit -> Preferences, click Advanced, then under the General tab, in the Browsing section, uncheck "Use hardware acceleration when available".
Now try the same site again. If you don't get CPU/memory overload, then we know that the problem is either in the 2D Canvas GPU acceleration (either Firefox's use of it, or in the backend graphics stack), or in the SVG renderer.
If you do get the same CPU/memory overload with hardware accel disabled, then it could be a bug in the SVG parser, which is probably done in pure software. Although, in that case, we would probably experience the problem on Windows as well, but we aren't (tested on FF 24.1.0 on Windows and it was slow, but not consuming all CPU and RAM like yours).
I suspect some kind of memory leak in Mesa.
A few more things to try
- Go to
about:support
in Firefox, click "Copy text to clipboard", and post that here (pastebin or so). This will help those of us familiar with the problem-space to determine what the situation is with your hardware and your graphics stack.
- Go to
about:memory
in Firefox, check the "Verbose" checkbox, then click "Measure". It would be awesome if you could do this just after you go to the offending page -- if you're able to get FF to do anything at that time.
- Run Firefox from the terminal as follows:
LIBGL_DEBUG=verbose firefox -safe-mode
. Navigate straight to the site that OOMs. Let it run for just a few seconds (enough to clearly start the problem, but don't let it overwhelm your system) then kill it. Post the output here, along with the output of dmesg
.
These things will give us more debug info to understand exactly where the problem is, but most of these steps are focused around the assumption that the problem is in the graphics stack. If it isn't, most of this won't be helpful.
Update: I created a raw github link that has no javascript or any tomfoolery whatsoever; it's just a laundry list of SVGs. It should crash if you have the defective behaviour, and it eliminates all other possible sources of the problem.
Update 2: The OP isolated the problem to this specific image.
The simplest solution is to use a batch file. The following was tested and confirmed to work with Firefox 30.0.
Associate .HTML Files With a Specific Firefox Profile
Create a batch file with something like the following -- for instance, for a web development profile called "Dev":
"C:\My Programs\FF30\firefox.exe" -P Dev -no-remote
You should omit any non-firefox command line switches in the .bat file commands (i.e. do not put in -osint -url "%1"). If you have never create a batch file, simply open a text file, type the appropriate command(s) and save. Then rename the file extension from .txt to .bat.
Depending on OS, the steps you want to take differ from here.
Windows XP
Navigate to My Computer and select the Tools -> Folder Options -> File Types tab. You need to change 4 file type associations.
- Firefox HTML Document
- Firefox URL
- URL: HyperText Transfer Protocol
- URL: HyperText Transfer Protocol with Privacy
To be clear, to create a link only for actual .html files, just the first item needs to edited. The Firefox URL (.url) is a separate type of file and the remaining two items are for opening external links in programs such as Outlook (e.g. you wish to click a link in your email and have your .bat file handle that link).
For each of these, you will need to select the Advanced button, then Edit the default "open" action. Under the field marked "Application used to perform action:"
paste the path to your .bat file e.g.
"C:\Documents and Settings\UserName\Desktop\Firefox.bat" "%1"
Make sure to use double quotes as above. Press OK, OK to finalize your changes.
You should, of course, copy the original entry in the field "just in case" and set it aside in case you want to reverse your changes at a later time. The basic form should be:
"C:\Path\To\Browser\firefox.exe" -osint -url "%1"
Please be aware that while changing all four options should not cause issues generally, the way any one program interprets a URL link or HTML page could be affected. Regarding comments by @Odys, there were no issues with links in Outlook Express 6, but extensive testing of other programs for linking issues has not be done.
Windows 7
Select any file ending in .html, right-click and select Properties -> General tab -> Change button. From the "Open with" menu, click the Browse button and a from the Selection dialog, find your batch file and click the Open button.
Note that this can be done from
Control Panel\Programs\Default Programs\Set Associations
as well.
Note, however, that if you attempt to change the protocols for links (HTTP and HTTPS respectively) at the bottom of this list (after file associations), there is no option to Browse for a program. This means that for Windows 7, you cannot associate links (e.g. in a mail client) with particular profile. It might be possible to change this somehow with registry editing, but this hasn't been tested.
In any case, you have now created a link between the .html file extension and your executable .bat that opens Firefox under a specific profile.
Notes
You may have to install a copy of Firefox outside the "Progams Files" or "Programs Files (x86)" folders (similar to the example .bat file command) to avoid permission issues in both XP and Windows 7.
Don't forget that to automatically log in to a profile, you will need to enable that option in the Firefox Profile Manage window (firefox.exe -P or -ProfileManager). A picture of the profile manager with the correct option checked is here.
Since Firefox uses whatever profile was last active when starting, you will likely want to create links to other .bat files to different profiles (e.g. to switch back to default from Dev, etc.)
Remember that every profile contains data about add-ons, themes, etc. so you will likely have to select these when creating new profiles (this is especially important to remember if you use the ProfileSwitcher add-on below.)
Links
Firefox Command Line Options are here. I noticed you have a small -p switch and its now officially a big -P for current versions (30.0+) of Firefox. I would check the other switches as well for proper syntax and support.
ProfileSwitcher -- An add-on to help verify which profile is currently active if you can't tell otherwise. Despite the comments regarding FF 29 compatibility, this does work with FF 30.0 as of version 1.6.2.
Best Answer
Sorry for the 3 years late answer, I became interested in this topic just now and found this question.
I didn't find a documented solution anywhere, so I checked out the source code and here is a very relevant part: http://dxr.mozilla.org/mozilla-central/source/toolkit/xre/nsAppRunner.cpp#1537
Here, the nullptr at the end of the line unfortunately means that the profile argument is not being passed to the SendCommandLine function, therefore it's not possible to select the correct firefox window to send the openurl message to.
However, we see that the username is being passed and that the username is being intiailized from the LOGNAME environment variable. Based on this, I came up with the following solution:
when ran the first time, it starts a new instance and the ~/.mozilla_profiles/facebook directory has to exist,
when ran the second time if the facebook profile is already running, it correctly connects to it,
it can send commands correctly to multiple different running profiles (of course you have to change the FOX_PROFILE parameter in the first line in the different scripts).
I tested this with Firefox 26 on Linux and it works.
Alternatively, here is my full-fledged solution that you may want or not want to use:
If you run the script without any parameter, it autoselects the default profile, but you can override it by setting FOX_PROFILE by hand in your shell. If an URL is passed in the command line, it always asks for a profile in which to open it, this is because I mainly click through from my chat and email program and in those case I want to always select a profile (google for calendar spam, facebook for birthday spam, etc.). Of course you can change the logic to fit your style of usage, this is just an example, the important knowledge is the LOGNAME trick.
And of course you have to make sure that this wrapper script is the only way to start the browser on your machine. Because if you open a profile without the correct LOGNAME set, than you won't be able to communicate to that profile anymore. I put this script as first in my path via multiple symlinked names, like x-www-browser, firefox, sensible-browser and put it in the BROWSER environment variable too. How to do this exactly depends on your GNU/Linux distribution.