Hi Arthur Francisco Araujo Fernandes,
Thank You for reaching out to Microsoft Q&A forum.
The error you are facing like out of memory can be due to high memory usage by running applications or insufficient memory allocation.
Ensure that the image you configured does not have any unnecessary services or applications running that could consume memory.
Ensure that the VM size you are using in your Azure Batch pool has sufficient memory and CPU resources.
Use the commands like top, htop, or free -m to check memory usage.
If you have any queries, please do let us know, we will help you.