If you are creating a new function, see the Console Quickstart on Cloud Run. The content on this page only applies to existing legacy functions created with the Cloud Functions v1 API.
Stay organized with collections
Save and categorize content based on your preferences.
Configure memory and vCPU limits (1st gen)
You can provision Cloud Run functions with different amounts of memory to control
the limit on how much memory a function can use. The amount of allocated
memory you choose corresponds to an amount of allocated CPU for your function.
Available memory and CPU tiers are shown in the following table:
Memory
CPU
128MB
.083 vCPU
256MB
.167 vCPU
512MB
.333 vCPU
1024MB
.583 vCPU
2048MB
1 vCPU
4096MB
2 vCPU
8192MB
2 vCPU
Not available
4 vCPU
Not available
8 vCPU
By default, the memory allocated for a function is 256MB or 256 MiB depending
on the Cloud Run functions product version.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[[["\u003cp\u003eCloud Run functions can be provisioned with varying memory amounts, which directly correlates to the allocated CPU for the function.\u003c/p\u003e\n"],["\u003cp\u003eThe memory and CPU tiers available range from 128MB with .083 vCPU to 8192MB with 2 vCPU, as outlined in the provided table.\u003c/p\u003e\n"],["\u003cp\u003eBy default, a function is allocated 256MB of memory, however, this can be changed.\u003c/p\u003e\n"],["\u003cp\u003eYou can adjust the allocated memory for a function during deployment using the \u003ccode\u003e--memory\u003c/code\u003e flag in the gcloud CLI or through the "Memory allocated" field in the Google Cloud console.\u003c/p\u003e\n"],["\u003cp\u003eMemory and CPU allocations impact the costs associated with running Cloud Run functions, detailed information regarding pricing can be found on the Cloud Run functions Pricing page.\u003c/p\u003e\n"]]],[],null,["# Configure memory and vCPU limits (1st gen)\n==========================================\n\nYou can provision Cloud Run functions with different amounts of memory to control\nthe limit on how much memory a function can use. The amount of allocated\nmemory you choose corresponds to an amount of allocated CPU for your function.\nAvailable memory and CPU tiers are shown in the following table:\n\n| **Note:** 1 vCPU is equal to 2.4GHz. CPU allocations are an approximation. Actual allocation of CPU clock cycles may vary slightly across function invocations.\n\nBy default, the memory allocated for a function is 256MB or 256 MiB depending\non the Cloud Run functions product version.\n\nSee [Cloud Run functions Pricing](/functions/pricing) for information about costs\nassociated with memory and CPU allocations.\n\nSet a memory limit\n------------------\n\nYou can set a function's allocated memory at deployment using the\nGoogle Cloud CLI or the Google Cloud console: \n\n### gcloud\n\nIf you are deploying a function using the gcloud CLI, use the\n[`--memory`](/sdk/gcloud/reference/functions/deploy#--memory) flag: \n\n```sh\ngcloud functions deploy YOUR_FUNCTION_NAME --no-gen2 --memory=MEMORY_LIMIT ...\n```\n\n### Console\n\nTo set the allocated memory during function creation in the\nGoogle Cloud console:\n\n1. Go to the [Cloud Run functions Overview page](https://console.cloud.google.com/functions/list) in the Google Cloud console.\n2. Click **Create function**.\n3. Fill in the required fields for your function.\n4. Expand the **Runtime, build...** section at the end of the page and click the **Runtime** tab.\n5. In the **Memory allocated** field, select an amount of memory.\n6. Click **Next**.\n7. Click **Deploy**."]]