New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
High memory usage when copying files to bucket #467
Comments
Hi, Have the same problem on Alpine Docker golang:1.15.4-alpine3.12 after upgrade on the gcsfue latest version.
Writing files 1.1Gb size to the mounted GCS bucket. Memory consumption on writing 4 files reaches 8-10Gb. I have the old one version of gcsfuse. Unfortunatelly can't say the exact version, but can suggest it is v0.28.1. This version works without memory consumption. |
I can't downgrade as I do use CMEK encrypted buckets and this doesn't work with 0.28 |
Increased memory consumption starts with release 0.31. , I did some tests today. |
Not sure if this is related, but it might be. Recently, a memory leak similar to the one in #204 has appeared on our backend using |
I am also experiencing this. After 20 seconds gcsfuse is using 40% of the RAM (of 2GB total), and after a minute or so it gets killed by OOM killer. FYI am running it with Using version 0.33.1 (Go version go1.15.7) |
I have downgraded to 0.32.0 and it is better but still leaks and is killed by OOM killer. |
This is not a memory leak. The memory spikes are the consequence of the files written to GCS being loaded entirely into memory. This is an implementation in the retry library (a part of the dependencies) to avoid file corruption. Since the retry was introduced in #414 and released in 0.31 or later, these memory spikes were not seen before 0.30. While a fix is planned, please specify
to avoid such issue now if you are using 0.31 or later. |
as @lezh mentioned it's not a memory leak, it's a "buffer/cache" in memory between sync/upload retries. |
Duplicate of #505. Please test the proposed PR referenced there. |
Updated via: govendor sync Fixes GoogleCloudPlatform#505. Fixes GoogleCloudPlatform#467. Fixes GoogleCloudPlatform#363.
Hi,
on a Redhat 7.9 server with gcsfuse-0.32.0-1.x86_64.rpm and google-cloud-sdk-319.0.0-1.x86_64.rpm, I experiance very high memory usage of the gcsfuse process, when writing to a mount from two different processes:
filesize about 1.5 GB
3 files written per minute
gcsfuse memory usage increases to 20GB
No files written to temporary directory
Mount:
gcsfuse --implicit-dirs -o allow_other --max-retry-sleep 2m0s --log-file /home/user/gcsfuse.log --temp-dir /u02/stage --key-file /home/user/mykey.json mybucket /u02/targetdir
If there are four parallel processes the memory usage increases to more then 30 GB
top - 21:43:56 up 10:54, 3 users, load average: 1.62, 0.66, 0.27
Tasks: 386 total, 1 running, 385 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.1 us, 1.8 sy, 0.0 ni, 77.9 id, 20.1 wa, 0.0 hi, 0.0 si, 0.1 st
KiB Mem : 92381128 total, 449948 free, 90713360 used, 1217820 buff/cache
KiB Swap: 10305528 total, 9543672 free, 761856 used. 940420 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
18669 testuser 20 0 36.5g 27.4g 3912 S 2.7 31.1 33:48.84 gcsfuse
The text was updated successfully, but these errors were encountered: