Explanation
Queries that return extremely large result sets can cause a memory error to occur.
Workaround
Limit your queries to the specific columns you need. In other words, do not use SELECT * on large tables.