Skip to content

Remove thread leaking in keylogger report() #4

Description

@anujbolewar

report() in keylogger.py uses threading.Timer(10, report) to schedule itself. This spawns a brand new OS thread every 10 seconds. Leave this running on a machine and it allocates thousands of dead threads and leaks memory.

The Fix:

Delete threading.Timer entirely.
Wrap the disk-flush logic in a simple while True: loop with time.sleep(10).
Spawn this loop exactly once as a single background daemon thread.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions