Skip to content

Astroid is leaking memory #1780

@matusvalo

Description

@matusvalo

Astroid is leaking memory when is run multiple times over same file using API

Steps to reproduce

  1. Pick larger file, e.g. file from pylint project: pylint/checkers/variables.py
  2. Run following script:
from pylint.lint import Run
from pylint.lint import pylinter
while True:
    Run(["pylint/checkers/variables.py"], exit=False)
    pylinter.MANAGER.clear_cache()

Current behavior

After ~12 iteration memory goes over 1 GB and keeps growing
image

Expected behavior

Allocated memory should not rise indefinitelly

python -c "from astroid import __pkginfo__; print(__pkginfo__.version)" output

2.13.0-dev0

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions