TOpenDialog causes a hang lazarus / 31-LCL ---------------------------------------------------------------------- wschulte · 2013-12-08 15:53 Somehow I miss something here I guess. In my application a user presses a button to select a number of file. After selection all files are handled (can be changing date/time, clearing EXIF-info and whatever). What I experience is that if a larger number of files is selected, the application "hangs" after the dialog closed. First I blamed a progress-control I made, but not using this, causes the same hang. It is more then 30 seconds -:(. Some testing reveiled that when I loaded the same list from a file, I didnt experience the hang. Only when using the TOpenDialog, I get a hang. So I tried to isolate it (see the attached zip for the sources). Though the effect in the example isnt as dramatic as in my application, it is still clearly there. When i use a file, I have a file with all the filenames exactly the same as I select them from TOpenDialog. Using some 278 files, causes a hang of more then 4 seconds. I guess I do something wrong, but what ? ANybody out there experienced the same ? And perhaps even solved it .. ? ---------------------------------------------------------------------- wschulte · 2013-12-08 16:31 Forgot to mention the versions:    Lazarus 1.0.12 r42479M FPC 2.6.2 x86_64-linux-gtk 2 Tried it on an 32 bit paltform with the same .. same result: TOpenDialog gives an extra hang. ---------------------------------------------------------------------- engkin · 2013-12-08 16:57 I tried your code on Windows. It worked with over 9000 html files. I did notice a few things: some shell extensions (mainly TortoiseSVN) and anti-virus software were busy with the files and around 40 MB were consumed by the application. Most of that was BEFORE closing the TOpenDialog. ---------------------------------------------------------------------- kpeters58 · 2013-12-09 20:23 As engkin stated, it works well under Windows: All 2,041 DLLs in the system32 directory on my Windows 7 box show up instantaneously. Will try it on one of my Macs later... ---------------------------------------------------------------------- wschulte · 2013-12-09 21:29 Thanks. So I am looking further. What is seeming to consume a lot of time is the process being in a "jbd2_log_wait_commit" state, but i cannot find the relevance of that yet. Some suggestions were made about mounting the file system etc, but no luck yet. Looking further I was stunned by the fact the process was doing disk- writes according to iotop  , even at a steady rate of 11-15 MB/s. But I don’t do any disk-IO at that moment (the original application as well as the sample behave the same in these aspects). So it looks I am getting this lag from the OS (Linux). I am going to find out more, especially I am getting curious to what this disk- writes is about ... Whats further quite curious is, that when debugging it and stepping line-by-line (F8) the debugger also gets hanging a few lines after the call to the TOpenDialog, in fact .. it is already processing the result of it .. the search goes on .. I wil keep you posted. And .. if anybody has a suggestion, I would be glad to hear it. ---------------------------------------------------------------------- wschulte · 2013-12-14 08:27 Ok, it all seems to run around xubuntu (or ubuntu) itself. I tried the program on a Fedora 15 distribution and guess what .. worked wonderful. No lagging after selecting the files, just running. My main guess it, it has to do with the recent files feature, well "recent-files.xbel" is the file popping up as being written quite extensivley. Didn't find a recepee to turn the keeping fo recent files of, that is .. not one that was working for me . So, should iI better switch to .. Fedora ? ---------------------------------------------------------------------- BigChimp · 2013-12-14 10:55 Or Debian, or LInux Mint probably...