Timeouts and browser memory issues when attempting to use the optimize application feature are the result of a known issue impacting particularly large apps.
Currently, the optimize application tool requires downloading the entire app into memory and checking many different combinations in order to see if things can be cleaned up. For very large apps, this can take longer than the allotted timeout, or may require downloading so much that the browser runs out of memory.
This is something that our engineering team is aware of and are working towards a longer-term resolution.