Hi @NGaur-3476,
Have you tried to change SKU worker plan? For example, to this one: Four vCPU/14 GB RAM
Workers are available in three fixed sizes: One vCPU/3.5 GB RAM; Two vCPU/7 GB RAM; Four vCPU/14 GB RAM
On the other hand, you could use Azure Automation Account with Hybrid Worker Server roles where you use any size of Azure VMs, especially if you think the problem occurs because of memory.
https://learn.microsoft.com/en-us/azure/automation/extension-based-hybrid-runbook-worker-install?tabs=windows