Kast2k Posted February 15, 2018 Share Posted February 15, 2018 Dear colleagues, At the current time i'm developing a information software that will run on server and clients (raspberry). Architecture (very common): 1. Server gets data from different sources and creating a bmp picture. 2. Clients are connecting server, getting picture and show it on form. Problems: 1. If i'm using UniCanvas then Chromium receives stack overflow after few hours (4-5). No free memory error. 2. if i'm using UniImage then picture is blinking. Picture is get by client on UniTimer. Example: procedure TframTest.tmrFillCNTValuesTimer(Sender: TObject); var Loff:string; bmp:TBitmap; begin bmp:=TBitmap.Create; try UniMainModule.SelectedRoute.FillcnvCounter(bmp,FBMPCounter,Loff); try UniImage2.BeginUpdate; UniImage2.Picture.Graphic.Assign(bmp); UniImage2.EndUpdate; // cnvCounter.BeginUpdate; // cnvCounter.BitmapCanvas.StretchDraw(cnvCounter.BitmapCanvas.ClipRect,bmp); // cnvCounter.EndUpdate; end; pnLineOffValue.Caption:=Loff; except on e:Exception do PostToLog('Cant find route '+UniMainModule.idRoute); end; finally bmp.Free; end; May be i'm doing something wrong? How can i receive picture from server without blinking or without memory overflow? PS. I read that chromium have a garbage collector bug with Canvas. Thank You. Quote Link to comment Share on other sites More sharing options...
rgreat Posted February 15, 2018 Share Posted February 15, 2018 I have the same issue. And not the only Chrome. TUniCanvas have large memory leak in other browsers too. Quote Link to comment Share on other sites More sharing options...
rgreat Posted February 15, 2018 Share Posted February 15, 2018 I had to use several TUniImages and add a lot of JS code to hide blinking and manage panning. And still result is not fully satisfy me. Quote Link to comment Share on other sites More sharing options...
Kast2k Posted February 15, 2018 Author Share Posted February 15, 2018 As temporary countermeasure i set Unitimer interval as 6000 (maximum production time available) and the result in Firefox-esr is about 10 hours, in Chrome - 6.5-7 hours. It always seems to be strange that this browsers are getting data, increasing used memory, cleaning memory. But at one time something is going wrong and free memory is decreasing critically without any garbage collection. Almost unknown situation. So sometimes i begin to think about using CrossVCL components, but the number (about 18) of current PC clients is pausing me. Quote Link to comment Share on other sites More sharing options...
rgreat Posted February 15, 2018 Share Posted February 15, 2018 It is simplier that that. Old picture memory just not being released when you assign new picture. That's all. Just create large bitmap and you'll see it clearly. Quote Link to comment Share on other sites More sharing options...
Kast2k Posted February 15, 2018 Author Share Posted February 15, 2018 It is simplier that that. Old picture memory just not being released when you assign new picture. That's all. Just create large bitmap and you'll see it clearly. I understand the process I dont understand what is happening inside browser at this moment Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.