Skip to content

[18.0] fs_attachment: memory issue (using _move_attachment_to_store) #535

@CRogos

Description

@CRogos

Is your feature request related to a problem?
We are running Odoo in odoo.sh shared instance.
We are using fs_storage + fs_attachment to use microsoft azure blob container to store attachments on some models.
With the _move_attachment_to_store method, we were able to migrate most of the existing attachments to azure (like suggested in #310), but we have some large files left which cannot be migrated, due to memory shortage.

2025-11-20 16:23:50,163 0 ERROR c4a8-production-1830547 odoo.sh: Worker process (pid=119731) was killed by signal 9 (most likely hit a memory limit, please check your custom modules memory usage.)

I assume that the file is cashed in memory instead of steaming the file.
We also get the same error message, when Odoo generates large attachments (>250mb) on a model with fs_attachment configured.

Describe the solution you'd like
Would it be possible to use streams to handle the payload instead of loading the total file into memory? Because we are running on odoo.sh we are not able to increase the max memory size/process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions