One can set configuration settings to limit the amount of memory that Firefox uses to cache pages and store session history.
You can look at what is currently in Firefox’s memory cache by putting this into the location bar:
about:cache?device=memory
Change the available settings. (For each you need to type about:config into the address sbar, in order to add the settings.)
browser.cache.memory.capacity
This limits the amount of memory that Firefox will use to store images. Set to the cache size you want in KB. So to set the maximum to 24MB give the number 24576.
browser.sessionhistory.max_total_viewers
This limits the amount of memory that Firefox will use to store old pages. This speeds up going backward and forward through pages.