Skip to content
This repository was archived by the owner on Jul 13, 2023. It is now read-only.
This repository was archived by the owner on Jul 13, 2023. It is now read-only.

A lot of temp files which are not explicitly unlinked #1326

@svetlins

Description

@svetlins

Hello,

On resizing uploaded images Paperclip creates a lot of Tempfiles (e.g. 6 styles = 13 Tempfiles) which are then not explicitly unlinked. On most Ruby implementations this is OK since the actual files are deleted when the Tempfiles instances are garbage collected. This is a problem though with JRuby since version 1.7.4 in which the behavior is changed so that files corresponding to Tempfiles are only deleted on process exit. Because of this our app started filling up /tmp since the upgrade to JRuby 1.7.4.

I would write an issue to JRuby about that but this piece of Ruby documentation discouraged me: http://www.ruby-doc.org/stdlib-1.9.3/libdoc/tempfile/rdoc/Tempfile.html#label-Explicit+close

It basically says that both deleting behaviors are allowed and that it's good practice to explicitly unlink created temp files anyway.

Do you think it's possible to add explicit unlinking of all created temp files to Paperclip? That would really help users of latest JRubies!

Best,
Svetlin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions