-
Notifications
You must be signed in to change notification settings - Fork 182
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
Disk space is not freed up after objects are deleted #2143
Comments
@skliarie correct, all uploaded files are deleted when the application is shut down. |
We use S3Mock (with persistence) for a quick and dirty backups.. Daily overwrites cause cause disk usage to grow. |
@skliarie How do you reproduce this? I refactored the "deleteOnExit" code, but I would like to reproduce the issue before / after: |
To reproduce:
|
which OS are you using? I just tested S3Mock directly on Ubuntu and disk space is freed up immediately when I delete an object. |
I use adobe/s3mock docker image from DockerHub with retainFilesOnExit: "true" |
and which OS are you using to host the container? |
The docker runs on Ubuntu 22.04.4 LTS awaiting for the image with the fix to show up on dockerhub. |
I fixed handling of InputStreams and OutputStreams that weren't closed in all cases. Calling DELETE on the API works, the file is deleted immediately (at least on my freshly installed Ubuntu server 24.04.1 VM). BEFORE This is how I it looks before the stream fixes with a ~640MB file. Even after shutting down S3Mock, the disk space is not released.
AFTER This is how I it looks after the stream fixes with the same ~640MB file. Before upload: 6.1GB used
|
The fix will be released with 4.0.0, but there are a few other fixes and features I'm looking into, thanks for your patience. Not 100% sure if I can keep file storage compatibility with 4.0.0 as I'm currently working on supporting versions, which may need incompatible changes in directories or files. |
It seems that java somehow keeps open handle on binaryData, even if the object was deleted, thus preventing OS to delete the file and reclaim the freed up disk space.
Restarting container frees up the disk space correctly.
The text was updated successfully, but these errors were encountered: