System.OutOfMemoryException in client app
The error you are seeing is being generated at the client end. Typically this error occurs when the client runs out of memory while trying to display or consume the result set.  Try running a smaller subset of queries, and ensure the client is properly disposing objects as they are no longer required.