https://bugs.kde.org/show_bug.cgi?id=483069

            Bug ID: 483069
           Summary: Memory leak in KRITA
    Classification: Applications
           Product: krita
           Version: 5.2.2
          Platform: Microsoft Windows
                OS: Microsoft Windows
            Status: REPORTED
          Severity: critical
          Priority: NOR
         Component: * Unknown
          Assignee: krita-bugs-n...@kde.org
          Reporter: baplo1...@gmail.com
  Target Milestone: ---

SUMMARY
Memory leak in KRITA
NOTE: If you are reporting a crash, please try to attach a backtrace with debug
symbols.
See
https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. Run KRITA
2.  Create New Document 512x512
3. I click on the "Configure" button in the ConfyUI plugin window to access the
configuration.
4. I don't click anything in this configuration, just observe the memory growth
in Process Hacker. I see that the RAM is being filled at intervals of 2-15
seconds on the krita.exe process. CONFYUI itself is not yet running.

The memory is not filling up much, approximately 0.10MB. I close the canvas
completely and exit the configuration. The memory does not fill up, but it
doesn't get released either. Moving on...

I create a new canvas again and launch ConfyUI, connect through Connect, and
set the Generation mode to LIVE. I press the Start button to initiate the
generation process in Live mode. Memory does not leak until the ready result
appears (a white image).

The white image is because I didn't draw anything, just started Live. At this
stage, when the image appears, the memory increases slightly and stops at
445.5MB.

No questions so far. Moving on...

I make the first stroke with a black color using a regular brush: 465MB. I make
the second stroke with a black color using a regular brush: 471MB. Wait for 20
seconds: 481MB. Increase the Strength from 30% to 90%: 488MB, 491MB, 492MB...
Wait for 1 minute: 511MB. Try to take the image from ConfyUI and transfer it to
the CANVAS: 539MB, 570MB, 581MB. I noticed that after taking the image by
pressing the "Copy the current result to the image as a new layer you want to
see, or leave empty" button, the memory started leaking rapidly. At the moment,
764MB, although no Krita operations are currently being performed. 30 seconds
after: 852MB. 870MB...

Try using this button 10 more times: 1GB. Now I will try to terminate ConfyUI
and disconnect it from KRITA by stopping and closing the canvas completely:
1.11GB. The leak has stopped, but the memory has not been freed.

Now I will try to repeat the same procedures, only close the canvas but not
close ConfyUI. 1.37GB. Now I close the canvas but do not close CONFYUI and
leave the program for 5 minutes: 1.37GB.

Conclusion: The leak only occurs when the canvas is open - very weakly and
tolerably. The leak occurs when working with ConfyUI, specifically, it is
strongly pronounced with "Strength around 60-100%" and pressing the "Copy the
current result to the image as a new layer you want to see, or leave empty"
button.

Memory is not cleared but preserved in KRITA until the program is completely
closed, for example, when memory is overloaded and the process crashes.

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 10
macOS: -
Linux/KDE Plasma: -
(available in About System)
KDE Plasma Version: I'm not aware of the version, but it's possibly the latest
one; I downloaded the program on March 9, 2024. 
KDE Frameworks Version:  I'm not aware of the version, but it's possibly the
latest one; I downloaded the program on March 9, 2024.
Qt Version:  I'm not aware of the version, but it's possibly the latest one; I
downloaded the program on March 9, 2024.

ADDITIONAL INFORMATION
The version of ConfyUI is the latest one available at the time of submitting
this report. No extra nodes are installed, only those required by KRITA with
the "Generative AI for Krita" plugin.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to