Skip to content

Memory Leak - ThreadingUDPServer #81570

Closed

Description

@danfdataforgeonca
BPO 37389
Nosy @vstinner
Superseder
  • bpo-37193: Memory leak while running TCP/UDPServer with socketserver.ThreadingMixIn
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2019-06-24.15:01:07.218>
    created_at = <Date 2019-06-24.14:53:55.531>
    labels = ['3.7', 'library', 'performance']
    title = 'Memory Leak - ThreadingUDPServer'
    updated_at = <Date 2019-06-24.15:01:07.213>
    user = 'https://bugs.python.org/danfdataforgeonca'

    bugs.python.org fields:

    activity = <Date 2019-06-24.15:01:07.213>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-06-24.15:01:07.218>
    closer = 'vstinner'
    components = ['Library (Lib)']
    creation = <Date 2019-06-24.14:53:55.531>
    creator = 'danf@dataforge.on.ca'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 37389
    keywords = []
    message_count = 3.0
    messages = ['346410', '346411', '346412']
    nosy_count = 2.0
    nosy_names = ['vstinner', 'danf@dataforge.on.ca']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '37193'
    type = 'performance'
    url = 'https://bugs.python.org/issue37389'
    versions = ['Python 3.7']

    Activity

    1. danfdataforgeonca commented on Jun 24, 2019

      danfdataforgeoncamannequin
      MannequinAuthor

      After putting a basic ThreadingUDPServer under load (500 messages per/second) I noticed that after a night it was consuming a lot of RAM given it does nothing with the data.

      On inception, I noticed the _thread count inside the server was growing forever even though the sub-threads are done.

      Setup a basic ThreadingUDPSever with handler that does nothing and check the request_queue_size, it seems to grow without limit.

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      performancePerformance or resource usage
      on Jun 24, 2019
    3. danfdataforgeonca commented on Jun 24, 2019

      danfdataforgeoncamannequin
      MannequinAuthor

      The only way I could figure out to control it was to do this in a thread;

              for thread in server._threads:  # type: Thread
                  if not thread.is_alive():
                      server._threads.remove(thread)

      Shouldn't the server process do this when the thread is done?

    4. vstinner commented on Jun 24, 2019

      @vstinner
      Member

      This issue is a duplicate of bpo-37193.

    5. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.7 (EOL)end of lifeperformancePerformance or resource usagestdlibStandard Library Python modules in the Lib/ directory

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions