Hi Melanie,
sorry for the very late answer, I've been preoccupied with my day job, wedding planning and my PhD defense. I think the problem is that you're looking at a massive need for memory: For the last localization, 5000 result images need to be kept in memory and potentially displayed. I assume that you already disabled the "Display image" checkbox in the viewer, but I suspect that it still won't be enough.
Three workarounds come to mind:
1. Reduce the output image's size by cropping (set minposx, minposy, maxposx and maxposy in the expression filter) and using larger pixel sizes.
2. Use a "Localization file" output so that you can write the localizations to 5000 different files and then use a batch script to convert each into an image.
3. Use a larger slice distance and run the job multiple times with different values for the first image to process.
I hope this helps, either you if you still have the problem, or a future reader.
Best regards, Steve