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

[BUG] Memory Leak using SkiaBitmapExportContext #25881

Open
dcaponetti opened this issue Nov 15, 2024 · 1 comment
Open

[BUG] Memory Leak using SkiaBitmapExportContext #25881

dcaponetti opened this issue Nov 15, 2024 · 1 comment
Labels
t/bug Something isn't working

Comments

@dcaponetti
Copy link

Description

Description
Good morning everyone,
We use Microsoft.Maui.Graphics and Microsoft.Maui.Graphics.Skia (ver 9.0.0) to generate images containing text and black and white graphics.

Unfortunately a serious memory leak problem causes the pods running on Kubernetes to restart every 3/4 hours.
I have included all the usings I could:

using (SkiaBitmapExportContext page = new SkiaBitmapExportContext(

 (int)HelperGraphic.PixelFromMillimeters(Convert.ToSingle(p.Width, System.Globalization.CultureInfo.InvariantCulture), _dpi),
 (int)HelperGraphic.PixelFromMillimeters(Convert.ToSingle(p.Height, System.Globalization.CultureInfo.InvariantCulture), _dpi),
 1.0f,disposeBitmap:true))

{
ICanvas g = page.Canvas;

 g.FillRectangle(0, 0,
     HelperGraphic.PixelFromMillimeters(Convert.ToSingle(p.Width, System.Globalization.CultureInfo.InvariantCulture), _dpi),
     HelperGraphic.PixelFromMillimeters(Convert.ToSingle(p.Height, System.Globalization.CultureInfo.InvariantCulture), _dpi));
 g.FillColor = Colors.White;

[.....]
using (IImage image = SkiaImage.FromStream(ms))
{
[....]

But the problem is not solved.
I attach the dump file of
MemoryDump.zip
the memory executed directly on the K8 pod.

Any ideas?
Thanks a lot.

Steps to Reproduce

No response

Link to public reproduction project repository

https://github.com/dcaponetti/TestImageAPI

Version with bug

9.0.10 SR1

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

No response

Affected platforms

Other (Tizen, Linux, etc. not supported by Microsoft directly), Windows

Affected platform versions

Kubernetes cluster with net8 windows image

Did you find any workaround?

no

Relevant log output

@dcaponetti dcaponetti added the t/bug Something isn't working label Nov 15, 2024
Copy link

We've found some similar issues:

If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.

Note: You can give me feedback by 👍 or 👎 this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant