Page 1 of 2

Windows 7 Kills XY on creating large # of thumbnails

Posted: 03 May 2012 10:22
by Zardoz2293
Windows 7 kills the XY process as it sees it as unresponsive when creating a large number of thumbnails. In this specific case it occured at 17,000 of 100,000 thumbnails. There is no way to allow XY to continue. Would be nice if XY would perform an OOP thumbnail creation, or sleep for 1ms, or the ugly DoEvents once every 30 seconds on thumbnail creation. -
26.png

Re: Windows 7 Kills XY on creating large # of thumbnails

Posted: 03 May 2012 11:24
by admin
Weird. It actually does a DoEvents every 250 msecs!

Re: Windows 7 Kills XY on creating large # of thumbnails

Posted: 03 May 2012 20:00
by Zardoz2293
admin wrote:Weird. It actually does a DoEvents every 250 msecs!
That is very interesting. Based on the behavior (occurs 100% of the time). Perhaps the DoEvents call isn't actually getting executed (something like a NOP/NOOP) -- perhaps the optimizer/linker/packaging tool you are using. Perhaps VB Runtime isn't able to process the Windows Message Loop. Why? If the Windows is terminating XY thinking or knowing from it's perspective XY is unresponsive. I suspect if you add the following registry entries you will have the same problem. However, it wouldn't explain why the DoEvents isn't processing the message loop.

Code: Select all

[HKEY_CURRENT_USER\Control Panel\Desktop]
"LowLevelHooksTimeout"="15000"
"AutoEndTasks"="0"
"HungAppTimeout"="30000"
"WaitToKillAppTimeout"="30000"
 
; SID: Local Service
[HKEY_USERS\S-1-5-19\Control Panel\Desktop]
"AutoEndTasks"="0"
"HungAppTimeout"="30000"
"WaitToKillAppTimeout"="30000"
 
; SID: Network Service
[HKEY_USERS\S-1-5-20\Control Panel\Desktop]
"AutoEndTasks"="0"
"HungAppTimeout"="30000"
"WaitToKillAppTimeout"="30000"

Re: Windows 7 Kills XY on creating large # of thumbnails

Posted: 03 May 2012 20:29
by admin
What are your thumbnails settings? "Create all at once"?

Re: Windows 7 Kills XY on creating large # of thumbnails

Posted: 03 May 2012 21:25
by Zardoz2293
admin wrote:What are your thumbnails settings? "Create all at once"?

Re: Windows 7 Kills XY on creating large # of thumbnails

Posted: 04 May 2012 09:13
by admin
Thank you. I made some changes and hope the next version will fix this.

Re: Windows 7 Kills XY on creating large # of thumbnails

Posted: 06 May 2012 13:00
by Zardoz2293
admin wrote:Thank you. I made some changes and hope the next version will fix this.
The update has significantly enhanced the thumbnail building process. :)

However, Windows 7 64-bit still terminates XY during thumbnail processing. It seems to occur consistently in the 12,000 - 17,000 range out of 100,000 but ONLY when you click or scroll or mouse scroll in the list view (during the thumbnail creation process).

Re: Windows 7 Kills XY on creating large # of thumbnails

Posted: 06 May 2012 13:15
by admin
Zardoz2293 wrote:
admin wrote:Thank you. I made some changes and hope the next version will fix this.
The update has significantly enhanced the thumbnail building process. :)
Fine, but in what way?
Zardoz2293 wrote:However, Windows 7 64-bit still terminates XY during thumbnail processing. It seems to occur consistently in the 12,000 - 17,000 range out of 100,000 but ONLY when you click or scroll or mouse scroll in the list view (during the thumbnail creation process).
Hmm, I'll see what I can do about that.

Re: Windows 7 Kills XY on creating large # of thumbnails

Posted: 06 May 2012 13:25
by Zardoz2293
admin wrote:Fine, but in what way?
Before it was impossible to change in the Tree View another folder until the thumbnail creation process was finished. Now you can.

admin wrote:Hmm, I'll see what I can do about that.
I'm now experiencing when Windows terminates XY, I'm getting two of the termination messages. The last time it was terminated only one message and now XY is displayed/loaded but totally unresponsive/greyed out with no activity (it's not processing the thumbnails -- reached 65,000).

On a side not, if XY doesn't finished the creation of the thumbnails, XY starts from the beginning again. So in something extreme like 100,000 files and you get to 99,999 and the hang event occurs, OR you click another folder, the next time you enter that prior folder thumbnail creation starts at file #1.

Re: Windows 7 Kills XY on creating large # of thumbnails

Posted: 06 May 2012 13:33
by admin
Interesting, so something changed from XP to Win7 in the effects of DoEvents and Sleep.

You got folders with more than 100,000 thumbnails? A little extreme, no?

Anyway, I just checked and did not find any reason anymore why Win7 would think XY is non-responsive. I'll keep an eye open nevertheless.

Re: Windows 7 Kills XY on creating large # of thumbnails

Posted: 06 May 2012 13:36
by Marco
Little consideration: 65000+ is 2^16. Maybe a buffer overflow somewhere?

Re: Windows 7 Kills XY on creating large # of thumbnails

Posted: 06 May 2012 13:40
by admin
Marco wrote:Little consideration: 65000+ is 2^16. Maybe a buffer overflow somewhere?
Yes, I saw that too, but it should generate an error message or a crash, neither of which happened. Also I almost never work with 16-bit numbers (but 32-bit), certainly not in the thumbnails code, so these numbers should not be a problem per se.

Re: Windows 7 Kills XY on creating large # of thumbnails

Posted: 07 May 2012 09:02
by Zardoz2293
admin wrote:Interesting, so something changed from XP to Win7 in the effects of DoEvents and Sleep.
Yeah, I think it's called the new world order. Typically the DoEvents is a total performance killer based on how it executes, it's surprising it's as fast as it is with this technique.

admin wrote:You got folders with more than 100,000 thumbnails? A little extreme, no?
Extreme is my middle name. It's unusual, as those files were in about 18,000 folders, but moved into one. I wouldn't be concerned about the apparent +/- 15,000 thumbnail at once creation limit. Efforts are better focused on future 64-bit product.

admin wrote:Anyway, I just checked and did not find any reason anymore why Win7 would think XY is non-responsive. I'll keep an eye open nevertheless.
The thumbnail creation is the only spot in XY or any other of hundreds I have on my system where the Windows 7 Kernel performs an application termination. Frankly, I see it as a Windows 7 failure, from the perspective, the end-user cannot override and prevent application termination, it's a done deal.

Re: Windows 7 Kills XY on creating large # of thumbnails

Posted: 07 May 2012 09:16
by Zardoz2293
admin wrote:
Marco wrote:Little consideration: 65000+ is 2^16. Maybe a buffer overflow somewhere?
Yes, I saw that too, but it should generate an error message or a crash, neither of which happened. Also I almost never work with 16-bit numbers (but 32-bit), certainly not in the thumbnails code, so these numbers should not be a problem per se.
The 65,000, is, I believe a coincidence when I happen to have clicked on XY, which was at that number, prior it was hanging at 15,000 when I clicked on XY. I believe it would have processed all of the thumbnails if I hadn't click on XY at during the thumbnail creation process. It's as if part of the windows message loop is being consumed and it, Windows, doesn't get the expected reply, hence, killing the process as non-responsive.

2^16 seems very odd as a boundary for a VB app, not a native max value. C/C++/C# sure. There's no native DWORD in VB so I'd expect to see integer wrap or overflow (if turned on) around max int and that isn't occurring. I know there are a lot of Win32 APIs that use DWORD and there was at one time several DWORD structures/methods/procedures in the public domain that both had a glitch in the conversion/overflow.

Thanks Don! I'll let it run right now to the 100,000 and provide feedback (I know it's going to work unless I click into it while it's doing it's thing).

Update (without intervention/touching/clicking in XY):
Run #1) Terminated @ 52,136 (one termination notice)
Run #2) Terminated @ 63,736 (one termination notice)
Run #3) Terminated @ 20,244 (two termination notices)
Run #4) Terminated @ 30,528 (one termination notice)
Run #5) Terminated @ 30,130 (one termination notice)
Run #6) Terminated @ 30,079 (one termination notice)
Run #7) Terminated @ 64,510 (one termination notice) - wouldn't terminate.
Run #8) Terminated @ 29,799 (one termination notice)

BINGO!
Run #9) Terminated @ ~54,xxx (Application Error) - see image
35.png

Re: Windows 7 Kills XY on creating large # of thumbnails

Posted: 07 May 2012 09:39
by admin
The next version (v11.00.0010) has a tiny change that might make another difference.