Hello, I've google cloud run service and I added in-memory volume, As test I made it size: `
const base64Data = await fs.readFile(fileName, 'base64')
console.log('base64 length ', typeof base64Data, ' , ', base64Data?.length)
const files = await fs.readdir('/mnt/memoryStorage-volume')
console.log('\nCurrent directory filenames:', files.length)
files.forEach(file => {
console.log(file)
})
Hi @IbrahimSluma,
When the in-memory volume hits its max size, further write operations will fail, usually causing an "out of memory" error. However, this doesn't automatically stop your container instance. Your app can catch and handle this error, allowing the container to keep running even though it's unable to write more data.
To troubleshoot, you can check your Cloud Logs for any "out of memory" errors. If you see messages indicating that your container instance is running out of memory, you can follow the suggested actions to resolve it, like increasing the memory allocation for your Cloud Run instance.
Just a heads-up: if your app itself throws memory-related errors (like java.lang.OutOfMemoryError
), this won't necessarily crash the container. As long as your overall memory usage doesn’t exceed the container's memory limit, the instance will keep running. However, this can still affect request handling, as the app might hang or time out if it's waiting for more memory but can't get it.
Hope this helps.
Nope, creating file didn't throw any error the file was created and I confirmed it was created because I run `
fs.readdir
and I can see the new file exist but it has no size at all ! ( no data )
Maybe there was small space left so file was created but without data ? but that's bug too because if file failed to write it should thrown error !