Automate - Out of Memory

Hi Speckle Team,

I have been working on a .net Automate function that has been working fine through local testing but now moving into production i get the following:

[prepare] 2025/10/27 18:45:37 Entrypoint initialization[79a0053d45-5710218482-1b3652] === Starting Speckle Model Merge Automation ===[79a0053d45-5710218482-1b3652] [79a0053d45-5710218482-1b3652] Step 1: Receiving main model...[79a0053d45-5710218482-1b3652] Out of memory.

it doesn’t seem to be getting much further than receiving the model automationContext Version Console.WriteLine("\nStep 1: Receiving main model...");:

 /// <summary>
 /// Initializes a new instance of the AutomateFunction class.
 /// </summary>
 /// <param name="operations">The operations service for sending/receiving Speckle objects.</param>
 public AutomateFunction(IOperations operations)
 {
     _operations = operations ?? throw new ArgumentNullException(nameof(operations));
 }

 /// <summary>
 /// Main function execution entry point.
 /// </summary>
 public async Task Run(
     IAutomationContext automationContext,
     FunctionInputs functionInputs
 )
 {
     Console.WriteLine("=== Starting Speckle Model Merge Automation ===");
     var stats = new ProcessingStats();

     try
     {
         // STEP 1: Receive main context model
         Console.WriteLine("\nStep 1: Receiving main model...");
         Base mainModelBase = await automationContext.ReceiveVersion();

         if (!(mainModelBase is Collection mainCollection))
         {
             automationContext.MarkRunFailed("Main model root is not a Collection");
             return;
         }

         Console.WriteLine($"Main model: {mainCollection.name}");

Any thoughts?

Thanks

as a bit more info running locally memory is ~700MB after receiving the first model which seems to be where the error is getting thrown from the messages in the consol and ~2GB at the end of the run when other models have been received processed etc.

From the specklesystems/speckle-automate-github-composite-action you can configure the amount of requested memory for your function with: speckle_function_recommended_memory_mi

For example:

- name: Speckle Automate Function - Build and Publish
        uses: specklesystems/speckle-automate-github-composite-action@0.9.2
        with:
          speckle_function_command: "dotnet app.dll"
          speckle_automate_url: "https://automate.speckle.dev"
          speckle_token: ${{ secrets.SPECKLE_PROD_FUNCTION_TOKEN }}
          speckle_function_id: ${{ secrets.SPECKLE_PROD_FUNCTION_ID }}
          speckle_function_input_schema_file_path: ${{ env.FUNCTION_SCHEMA_FILE_NAME }}
          speckle_function_recommended_memory_mi: 4000

Feel free to bump this and test how your function performs! This does appear to exceed the default limits.

thanks that resolved the issue I had

1 Like