After some years of using Firefox (currently version 38.0.5) with Session Restore enabled (the browser saves all the tabs from the previous session and reload them at the next start-up) it started to act weird and freeze for around 10 seconds 3 or 4 times a day.
This very annoying behavior is caused by the presence of multiple useless Session Restore files.
To delete those files open a new tab and type about:support in the address bar, then in the Application Basics area click on the Open Directory button placed next to Profile Directory.
Delete every file named sessionstore_something_.js and everything inside sessionstore-backups directory.
Close and reopen Firefox, this should solve the problem.