Can Firefox kill my background script if it's out of memory?

According to this thread:

…Chrome may kill them on low-memory, but Firefox (currently!) does not do so.
So, to be good/future-proof, you should maybe still rather code it in a way that does not rely on having background pages always accessible.

Basically, I’d say storing multiple MB images in a background script is not really a good idea. Remember it stays in memory all the time (if it does, of course), so this can be a big waste of RAM.