I am unsure whether or not newer versions of Firefox have this option enabled by default, but there does exist the option to provide maximum RAM and disk cache usages in Firefox. This is much different than changing the memory cleanup and garbage collection options, as you can force Firefox to use less RAM and use more disk cache.
To limit the amount of RAM Firefox uses before using the disk cache, navigate your browser to about:config. In the Filter, enter "memory", and you should see:
browser.cache.memory.capacity
If you don't, then you will need to manually create this key as an integer value. This integer value represents the memory cache (in kilobytes) that Firefox can use. I personally set this value to 131072 (128 MB). To avoid Firefox running out of memory, you can then increase the disk cache it uses by changing the following variable (you can just use "disk" as the search filter).
browser.cache.disk.capacity
Again, this is the disk cache (in kilobytes) as an integer value, and if it does not exist, you must create it. I personally set mine to 307200 (300 MB). Note that this is different from the amount of storage Firefox uses to store offline files or your history.