Firefox has a history of using up a lot of memory when used for a long time or when used with many open tabs. Mozilla support and mozillaZine both recommend the periodic restart of Firefox.
Firefox’s memory usage may increase if it’s left open for long periods of time. A workaround for this is to periodically restart Firefox. You can configure Firefox to save your tabs and windows so that when you start it again, you can start where you left off. See Session Restore for details. – Mozilla
If you find that Firefox’s memory usage continues to grow after long periods of being open, you may want to consider periodically restarting Firefox to bring the memory usage back to reasonable levels. Close Firefox and select the Save and Quit option to reopen your tabs when Firefox restarts. – mozillaZine
There is now a Firefox add-on that makes this easy. Memory Restart is a new Firefox add-on that displays Firefox memory usage in the status bar. If it reaches a configurable memory threshold, the memory display color will turn red. When you are ready to restart, just click on the red memory display and Firefox will restart. Use with Firefox’s session restore feature so you don’t lose your current tabs.