Firefox supports the option "javascript.options.mem.max" and if you search on that you can find discussions about sensible values that people have found workable.
Not sure how many people can be bothered going in there and setting it, but speaking for myself I set it to 128000 (which is 128M).