-
-
Notifications
You must be signed in to change notification settings - Fork 444
Description
Prerequisites
- I have written a descriptive issue title
- I have verified that I am using the latest version of Magick.NET
- I have searched open and closed issues to ensure it has not already been reported
Description
Hi @dlemstra ,
I am using the Magick.Net.Net-Q16-x86 v 7.8.0 in a small console application.
It is being used to convert svg text to bmp image.
I am using RED ANT to do the memory profiling and seeing that the memory occupied by Magick.Net is growing a little every time . Here is the how to reproduce it
Steps to Reproduce
I have a simple class MgTester with the following fucntion :
public void PrintBagTag( string svgString )
{
{
MagickReadSettings setting = new MagickReadSettings();
setting.Format = MagickFormat.Svg;
setting.Density = new Density(300, 300);
var svgBytes = Encoding.ASCII.GetBytes(svgString);
using (MemoryStream ms = new MemoryStream())
{
using (MagickImage iim = new MagickImage(svgBytes, setting))
{
iim.Format = MagickFormat.Bmp;
iim.Write(ms);
_bagtag = Image.FromStream(ms);
}
}
if (_bagtag != null)
PrintDocument.Print();
if (_bagtag != null)
_bagtag.Dispose();
_bagtag = null;
}
}
And Here is the main program :
static void Main(string[] args)
{
var mgTester = new MgTester();
Console.WriteLine("Press any key to start the test! ");
Console.ReadKey();
for (int j = 0; j < 3; j++)
{
for (int i = 0; i < 100; i++)
{
string BagTagSvg;
BagTagSvg = File.ReadAllText(@"TestBagTag.svg");
Task.Factory.StartNew(() =>
{
mgTester.PrintBagTag(BagTagSvg);
});
Thread.Sleep(4000);
}
Console.WriteLine("Lot : " + j.ToString() );
Console.ReadKey();
}
Console.WriteLine("Press any key to exit! ");
Console.ReadKey();
}
}
This application is printing 3 lots of a bmp image , which is a conversion from a SVG text . The SVG text is read from a SVG file . Each lot it repeats the conversion and print for 100 times.
After the first lot the RED ANT profiler is telling me that Magick.Net is occupying 1.426 Mb
After the second lot Magick.Net is occupying 2.275 Mb
After the third lot Magick.Net is occupying 3.048 Mb
Can you please have a look ?
If you want I can send you the whole project .
System Configuration
-
Magick.NET version:7.8.0
-
Environment (Operating system, version and so on): Windows 10 Pro 64 bit x64- based proccessor . RAM 32 Gb
-
Additional information: