Send feedback
Stay organized with collections
Save and categorize content based on your preferences.
Note:
This content applies only to Cloud Run functions (1st gen)—formerly Cloud Functions (1st gen).
For the Cloud Run functions of this document, see
Configure memory and vCPU limits .
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
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.
By default, the memory allocated for a function is 256MB or 256 MiB depending
on the Cloud Run functions product version.
See Cloud Run functions Pricing for information about costs
associated with memory and CPU allocations.
Set a memory limit
You can set a function's allocated memory at deployment using the
Google Cloud CLI or the Google Cloud console:
gcloud If you are deploying a function using the gcloud CLI, use the
--memory
flag:
gcloud functions deploy YOUR_FUNCTION_NAME --no-gen2 --memory=MEMORY_LIMIT ...
Console To set the allocated memory during function creation in the
Google Cloud console:
Go to the
Cloud Run functions Overview page in
the Google Cloud console.
Click Create function .
Fill in the required fields for your function.
Expand the Runtime, build... section at the end of the page and click
the Runtime tab.
In the Memory allocated field, select an amount of memory.
Click Next .
Click Deploy .
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-25 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
Need to tell us more?
{"lastModified": "Last updated 2024-09-25 UTC."}
[[["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 2024-09-25 UTC."]]