Forum > LCL

[UPDATE] TOpenDialog - 100% CPU - Fan Revs Up

(1/9) > >>

Lazarus 2.0.12 / FPC 3.2.2. Linux Manjaro. When I go to open an image file in a directory with 30000 video frames the program stalls, the fan revs up, and the CPU usage hits 100%. I suspect one of the widgets used by Lazarus is becoming unnecessarily busy. My workaround is to change the type of dialog from TOpenDialog to TSaveDialog. This solves the problem. It's weird having to click the "Save" button to open a file. But at least it gets the job done. This problem has occurred often in the past. I never really came up with a good trick until now.

Grahame Grieve:
is this under the debugger? on windows? or other platforms?

It happens when both debug and release builds are run from Lazarus. It happens when the release build is run from the command line. I haven't run the debug build from the command line. I don't know the behavior on Windows. On Linux (Manjaro) the "busy" cursor (circling arrows) is shown whenever the mouse is over the dialog. All other applications work fine. The dialog is just maxing out a single core. 100% CPU shown when you run top. 23% CPU shown by Psensor. The temperature of one core is 71C, the other cores approx 30C.

30,000 files in that directory ?  It sounds to me like TOpenDialog is trying to populate its list with all those files. Thats a lot of entries.

In an unrelated exercise, I just established that calling FileExists() uses up a few mS on my pretty fast system. Doing it 30,000 times would take at least a minute. So, did you let it run to completion ? When it finished, finally, did the OpenDialog list make sense ?

On the other hand, wonder why SaveDialog is so much faster ?


Given the diff between open and save dlg, my *guess* would be it collects some info for "preview".
Not sure, does the Linux open dlg has a preview?


[0] Message Index

[#] Next page

Go to full version