There are several posibilities:
1) You may have memory leaking in SQL. E.g. if you use sp_xml_preparedocument and forgot or bypassed sp_xml_removedocument.
2) You may need more RAM.
3) It may be caused by other apps on the server.
You need to figure out the root cuase. Increasing the VM is not the way to solve the issue though it may temporarily mitigate it.