-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Related issues
None.
[REQUIRED] Version info
node: v12.22.1
firebase-functions: 3.15.4
firebase-tools: 9.16.5
firebase-admin: 9.11.1
[REQUIRED] Test case
export const test = functions
.runWith({
memory: '8GB',
})
.https.onRequest(async (req, res) => {
console.log(process.env);
});
[REQUIRED] Steps to reproduce
Just try to deploy the above mentioned function
[REQUIRED] Expected behavior
The function gets deployed with the indicated memory and it can fully use the 8 GiB memory.
[REQUIRED] Actual behavior
The function gets deployed with the indicated memory, but, it won't be able to use it all, since the runtime is configured to only use 1 or 2 GiB.
As stated in the Google Cloud documentation here, you need to specify the NODE_OPTIONS
environment variable to have a max_old_space_size
value (8192 for 8 GiB), but this is not possible with current firebase-functions deployment process.
I suggest that when a function is required to have more than 1 GiB memory size the given NODE_OPTIONS
environment variable is set automatically. At this stage, to have it set, I need to go to Google Cloud Console, edit the function and manually add the environment variable (or at least check it was retained) after every deploy.
Were you able to successfully deploy your functions?
Yes.