| Summary: | Memory Leak with calls to Application.documents() in Python | ||
|---|---|---|---|
| Product: | [Applications] krita | Reporter: | tom-jk <monobaker> |
| Component: | Scripting | Assignee: | Krita Bugs <krita-bugs-null> |
| Status: | REPORTED --- | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | nightly build (please specify the git hash!) | ||
| Target Milestone: | --- | ||
| Platform: | Appimage | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
Looking at just the Krita class (https://api.kde.org/krita/html/classKrita.html): documents(), views() and windows() all leak. extensions(), dockers() and actions() do not leak. The leaky ones are putting new things in a list, while the ones that don't are just doing "return a->b". |
SUMMARY Krita memory usage increases with each call to Application.documents(), or Krita.instance().documents(), or ki.documents() where ki = Krita.instance(). STEPS TO REPRODUCE 1. Have some images open in Krita. 2. Open Scripter. 3. Paste and Run the following: ki = Krita.instance() for i in range(0, 50000): ki.documents() OBSERVED RESULT Approximate change in krita memory usage as shown by system monitor: images open - total change - change per call (total change/50000) 0 images - 0mb - 0mb 1 image - 22mb - 0.45kb 8 images - 150-200mb - 3.1-4.1kb 16 images - 335mb - 6.86kb EXPECTED RESULT no change in memory usage. SOFTWARE/OS VERSIONS Linux Mint 20 Cinnamon Qt Version: 5.15.7 Krita Nightly Build #1910 (11-Feb-2023 16:09:00) 3cf61b0430093e9d3413f8a4325f78bf089df144 ADDITIONAL INFORMATION - Assigning ki.documents() to variable, setting variable to None, doing del on variable - make no difference.