I also encountered the same issue while trying to update the Semantic Model for Power BI Embedded SKU A1. Despite the dataset being around 300MB, it consumed 2.7GB of memory and resulted in an error.
Upon investigation, I found a thread where the following explanation was provided:
"When many relationships are defined, it consumes more memory.Additionally, if data refresh and relationship calculations are performed simultaneously, a large amount of data is loaded into memory at the same time, leading to memory exhaustion."
Based on this, I followed these steps, and I was able to successfully perform the update using PowerBI API:
Perform an update using the following endpoint
POST https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/refreshes { "type": "DataOnly" }
Monitor the endpoint and wait for the dataset refresh to complete.
GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/refreshes
Perform an update using the following endpoint
POST https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/refreshes { "type": "Calculate" }
I hope this method works in your environment as well.
Reference:
https://learn.microsoft.com/ja-jp/rest/api/power-bi/datasets/refresh-dataset
https://learn.microsoft.com/ja-jp/rest/api/power-bi/datasets/get-refresh-history