Hi @Akeem Afuwape (CA),
Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
To resolve your out-of-memory error (Python code 137) on Azure Functions with a Premium v3 P3V3 plan, consider the following alternatives:
- Since you've optimized your code, consider profiling your function app to find memory bottlenecks. Tools like Azure Application Insights can help monitor memory usage and performance.
- The Premium plan offers various instance sizes. The P3V3 plan should provide enough memory, but if you're frequently hitting limits, ensure you're using the maximum available memory for your instance and adjust your allocation if needed.
- If issues persist, consider upgrading to a larger instance size. The Premium plan has various SKUs with different memory capacities, and a higher SKU may better support your workload.
- Ensure your function app settings allow for higher memory usage. For instance, set the Bitness Platform to 64 Bit if you're on a plan with over 4 GB of memory.
- If your function handles large files, consider splitting the workload into smaller chunks or using asynchronous processing to lower peak memory usage.
- If your function uses external libraries or services, verify they aren't causing memory bloat, as third-party libraries can sometimes introduce inefficiencies.
- For your second question about selecting memory above 1.8GB, check the instance memory size options in your Premium plan. The P3V3 plan should support higher memory configurations, so ensure you choose the correct settings in the Azure portal.
For further clarification, please refer to the following documentations:
Troubleshoot Python errors in Azure Functions (python-mode-configuration)
I hope the above provided information will helps in better understanding and solve your issue, if you have any further concerns, please feel free to reach out to us.