This problem seems to be resolved in libggdiplus6.0.5.
The library I compiled with the latest code does not have this problem.
System.Drawing.Common 'Out of memory.'
When I execute the following code snippet in a Linux environment, an out of memory error occurs.
System.Collections.Stack GraphicsStateStack = new System.Collections.Stack();
Bitmap bmp = new Bitmap(500,600);
Graphics gm = Graphics.FromImage(bmp);
for(int i=0; i<1000; ++i)
{
GraphicsStateStack.Push(gm.Save());
GraphicsState st = (GraphicsState)GraphicsStateStack.Pop();
gm.Restore(st);
st = null;
}
But I did not find that the memory is being used a lot.
My environment information is as follows:
The same code does not report an error under window.
This confuses me.
1 answer
Sort by: Most helpful
-
Carl Yang 1 Reputation point
2021-10-13T02:45:17.83+00:00