DzHTMLText icon indicating copy to clipboard operation
DzHTMLText copied to clipboard

Out of resources

Open NORECS opened this issue 3 years ago • 5 comments

I've no idea what is happening but maybe it's DzHTMLText related?

Could be that doing few hours of repainting once per second leads to "Out of resources".

I have reportmemleaksonshutdown = true, and I don't get anything, but not sure if memory leaks from thread I have are reported.

Will try with madExcept turned on, maybe I'll get more info, but not sure I have enough time for another loop until tomorrow.

This is the call stack that made me think it could be related.

:754d46d2 KERNELBASE.RaiseException + 0x62
Vcl.Graphics.OutOfResources
Vcl.Graphics.GDIError
Vcl.Graphics.GDICheck(0)
Vcl.Graphics.CopyBitmap(0,0,0,$19F70C,nil)
Vcl.Graphics.TBitmap.CopyImage(0,0,((0, 3832, 2001, 0, 0, 0, nil), (0, 3832, 2001, 0, 0, 0, 0, 0, 0, 0, 0), (0, 0, 0), 0, 0))
Vcl.Graphics.TBitmap.SetSize(???,???)
Vcl.DzHTMLText.TDzHTMLText.DoPaint
Vcl.DzHTMLText.TDzHTMLText.Paint
Vcl.Controls.TGraphicControl.WMPaint(???)
Vcl.Controls.TControl.WndProc((15, 1174475909, 0, 0, 5253, 17921, (), 0, 0, (), 0, 0, ()))
Vcl.Controls.TControl.Perform(???,???,0)
Vcl.Controls.TWinControl.PaintControls(1174475909,???)
Vcl.Controls.TWinControl.PaintHandler((15, (), 0, 0, 0))
Vcl.Controls.TWinControl.WMPaint((15, (), 0, 0, 0))
Vcl.Controls.TControl.WndProc((15, 0, 0, 0, 0, 0, (), 0, 0, (), 0, 0, ()))
Vcl.Controls.TWinControl.WndProc((15, 0, 0, 0, 0, 0, (), 0, 0, (), 0, 0, ()))
Vcl.Controls.TWinControl.MainWndProc(???)
System.Classes.StdWndProc(7014178,15,0,0)
:76d747ab USER32.AddClipboardFormatListener + 0x4b
:76d552ac ; C:\WINDOWS\SysWOW64\USER32.dll
:76d54e4a ; C:\WINDOWS\SysWOW64\USER32.dll
:76d5e4cf ; C:\WINDOWS\SysWOW64\USER32.dll
:7755537d ntdll.KiUserCallbackDispatcher + 0x4d
:76d541e0 USER32.DispatchMessageW + 0x10
Vcl.Forms.TApplication.ProcessMessage(???)

NORECS avatar Nov 01 '21 14:11 NORECS

Here's an interesting thread https://stackoverflow.com/questions/2180345/hunting-down-eoutofresources

NORECS avatar Nov 08 '21 12:11 NORECS

I ran my program today > 4 hours, at least twice as long as before, without running out of resources. Only difference is I haven't clicked any links. So that may be related.

NORECS avatar Nov 19 '21 12:11 NORECS

Are you using Thread or Application.ProcessMessages in your app?

It could be a problem with internal canvas control.

digao-dalpiaz avatar Nov 22 '21 01:11 digao-dalpiaz

I made a fix to lock the canvas when painting the control. Please test your environment to see if any changes result.

Download the changes using this branch: https://github.com/digao-dalpiaz/DzHTMLText/tree/paint-out-of-res

digao-dalpiaz avatar Nov 22 '21 01:11 digao-dalpiaz

Hello!

@NORECS, are you still having this problem ?

digao-dalpiaz avatar Sep 04 '22 12:09 digao-dalpiaz

Please, read this information about the same error: https://stackoverflow.com/questions/24013287/drawing-transparent-message-to-screen-gives-out-of-system-resources

Maybe you are docking the component, and in a specific case, the bounds (Width and Height) became negative, so that error will raise.

This problem occurs in VCL environment because we are using an internal Bitmap to draw component image:

  B := TBitmap.Create;
  try
    B.SetSize(Width, Height);
    CanvasProcess(B.Canvas);
    Canvas.Draw(0, 0, B);
  finally
    B.Free;
  end;

digao-dalpiaz avatar Apr 14 '23 16:04 digao-dalpiaz

Hello @NORECS , Are you still having this problem with the component?

digao-dalpiaz avatar Dec 12 '23 12:12 digao-dalpiaz

Closing this issue as there was no response.

digao-dalpiaz avatar Jan 16 '24 01:01 digao-dalpiaz