[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-03。"],[[["\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**."]]