Out of memory error when trying to print / email - Article from the Sage Community Hub
Out of memory error does not mean you have run out of free memory. Rather you do not have enough contiguous memory for some data necessary when processing/generating the report.
Your error is not caused by the data being too large - you have actually proven that by virtue of the fact you can successfully run the report after restarting the application.
Removing old data is a red herring I'm afraid. Removing data has value in that it may have performance benefits both for reporting and general use of the software, but it will not resolve an out of memory error except in very, very specific situations. I can guarantee you are not in this situation as you can run the reports after restarting but if you want to be 100% sure run the check data routines with the software and confirm there are no errors / warnings produced.
Resetting the default printer driver and turning off save printer settings, as suggested in the linked article, is unlikely to have any real effect either.
One thing that definitely will help from that article is the first suggestion of rebooting the PC. Restarting Sage 50 Accounts can also help as you have found already.
Reducing the overall memory requirements of the report can help. Certainly the last item mentioned on the linked article around image is a valid thing to check. If you have any high resolution images in the report you are generating try reducing the resolution or removing it entirely.
NOTE: The resolution and the actual display size on an image are not the same thing. Beyond that look at removing any unnecessary processing or data from the report e.g. remove any unnecessary sections, formulas or sorting from the report. Also whenever possible make sure you use report level filters or criteria to restrict data in the report rather than filter expressions on a section to show/hide data.
As this is a fairly involved process I would recommend confirming it is the layout causing/contributing to the issue before doing any work on the reports to. To help confirm it is related to the report layout what you could do is when you get the error try running a different, simpler report e.g. the customer list report. If this runs OK then the above stuff is what I'd recommend looking at next.
Hope that helps