Hi
Clearly this is a memory resource problem, but you do have to ask why? Why do you not use the DB to filter the rows before retrieval rather than apply a filter to 8M rows afterwards.
What are you doing with 8M rows of data, how are they being processed. I cannot believe a user is reviewing this number of rows so whatever you are doing could and should be done at the database layer for performance.
I think you need to question your application design when you start hitting these sorts of problems.
Could you now use a cursor to extract and process the data?
I hope that you will take these thought in the helpful manner they are intended, and consider your approach.
Kind regards
David