Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memory leak on self._create_readonly += relations_includes #257

Closed
qianyi3210 opened this issue May 12, 2020 · 3 comments
Closed

memory leak on self._create_readonly += relations_includes #257

qianyi3210 opened this issue May 12, 2020 · 3 comments
Assignees
Labels

Comments

@qianyi3210
Copy link

qianyi3210 commented May 12, 2020

redminelib/resources/base.py
128 self._create_readonly += relations_includes
129 self._update_readonly += relations_includes

tools shows memory leak on these two lines, any suggestion?

@maxtepkeev maxtepkeev self-assigned this May 12, 2020
@maxtepkeev
Copy link
Owner

maxtepkeev commented May 12, 2020

@qianyi3210 which tools ?

@qianyi3210
Copy link
Author

qianyi3210 commented May 12, 2020

@maxtepkeev
tracemalloc
mycode is as below:

class RedmineService(object):
    def __init__(self):
         # self.logger = logger
         self.client = Redmine(_conf.get("redmine", "rm_url"),
                              username=_conf.get("redmine", "rm_username"),
                              password=_conf.get("redmine", "rm_password"),
                              requests={"verify": False})

    def is_issue_exist(self, project_id, subject):
        issues = self.client.issue.filter(project_id=project_id, status_id="open")
        for issue in issues:
            if subject == issue.subject:
                return True
        else:
            return False

redmine_service = RedmineService()

i will call redmine_service.is_issue_exist() many times

maxtepkeev added a commit that referenced this issue May 13, 2020
@maxtepkeev maxtepkeev added bug and removed question labels May 13, 2020
@maxtepkeev
Copy link
Owner

maxtepkeev commented May 13, 2020

Good find, thanks. Fixed in 5b8d4c4.

avgas3 pushed a commit to avgas3/python-redmine that referenced this issue Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants