It never happened to me that I wanted to restore more than two tabs in Firefox and even that happened only once since the feature has been introduced to the browser. A right-click on a tab opens a menu that has an option to undo the last closing of a tab in Firefox.
Firefox is saving the last ten closed tabs which is in my opinion to much unless you open and close tabs all the time and work with 30+ open tabs. I prefer to set this value to 2 which is the best value in my opinion. I cannot really say if this has an impact on Firefox memory usage or performance but it probably has since the data has to be stored somewhere.
Type about:config in the location bar of Firefox and filter for the parameter browser.sessionstore.max_tabs_undo. The default value of it is ten. Double-click the name and you should see a form popping up where that value can be changed. It is naturally possible to increase the value instead of reducing it. If any of you notice a performance increase or decrease let me know.
Related posts:
Change the Session Store Interval in FirefoxChange Single- and Middle-Click behavior in the Firefox location bar
Change Firefox 3 Full Screen Mode
Change the number of results in the Firefox 3 location bar
Change The Location Of Close Button In Firefox


[...] Via | gHacks [...]
[...] Change the Number of Tabs Firefox Can Undo By default Firefox is capable of undoing the last 10 tabs that you’ve closed, but that can be changed to anything you’d like. If you extensively use the undo tab feature you might want to consider increasing the number, otherwise you can decrease it. [...]