Skip to content

Memory leak occurs when using multiprocessing with large data objects #140885

@abhiramch018

Description

@abhiramch018

Bug report

Bug description:

When using the multiprocessing module in Python to handle large data objects, I noticed that the memory usage keeps increasing even after all processes are finished. The memory is not released properly, which suggests a possible memory leak when transferring big objects between processes.

This issue mainly happens when sending large lists or dictionaries through multiprocessing.Queue or Pipe. The child processes seem to hold references even after termination, and garbage collection does not free the memory completely. This causes performance degradation and can lead to crashes in long-running scripts.

CPython versions tested on:

3.12

Operating systems tested on:

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    pendingThe issue will be closed if no feedback is providedtopic-multiprocessingtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions