Hi ortiga,
the reason why you are able to acquire, process and display data in older program without memory problem is that you throw away data after each iteration (data is only displayed) and wait until processing is done, then measure another chunk of data. In newer program with queues acquires data with no delay and FFT is slower than acquiring so queue works as a buffer which is filling the RAM and this is causing memory problems.
The only solution I see here is only to upgrade HW (mainly processing speed) to make FFT processing faster (but this still does not solve problem totally) or decrease number of samples or sampling rate. Be aware that you are trying to do very difficult task in perspective of processing power so duration about 1 minute is something you have to deal with.
Best regards,
Martin