Last week, Microsoft released an out-of-band hotfix to resolve an issue surrounding excessive RESOURCE_SEMAPHORE_QUERY_COMPILE waits. If you are experiencing this issue, or if you are diligent about applying the most recent hotfixes, you should apply this fix.
You will need to enable trace flag 6498 in order to benefit from the fix; installing the hotfix alone will not resolve the issue.
You can get the hotfix from:
Your @@VERSION will be bumped to 12.0.2464.