Skip to content

Memory leak using func_timeout . #9

@Utsav13

Description

@Utsav13
def get_video_capture2(timeout=1):
        try:
            ReturnValue = func_timeout(timeout , cap .read)
            return ReturnValue
        except FunctionTimedOut:
            print("cap .read could not complete within {} seconds and was terminated".format(timeout))
        except Exception as e:
            print("Exception in cap.read() = {}".format(e))

Here is my python function where I use func_timeout.
without func_timeout memory leak is not found in this code.
I also try to free an object using del obj, but no changes were detected.

using del obj, python code


def get_video_capture2(timeout=1):
        global frame
        try:
            ReturnValue = func_timeout(timeout , cap .read)
            frame = ReturnValue
            del  ReturnValue
            return True
        except FunctionTimedOut:
            print("cap .read could not complete within {} seconds and was terminated".format(timeout))
        except Exception as e:
            print("Exception in cap.read() = {}".format(e))

so how can I free my memory ??

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