I don't use Microsoft products but did you Google the error it's giving you "There is insufficient system memory in resource pool 'internal' to run this query"? That's an error from the SQL server, not Moodle.
There seems to be loads of information online that might help you.