Page 1 of 1

Shareaza hanging frequently while downloading

PostPosted: 05 Jun 2011 23:40
by old_death
I have been downloading a large torrent today (several GBs). During doing so, I have noticed what might be the reason for the Shareaza GUI hanging so frequently while heavily downloading: Everything was fine until I started to move some 400 GB from one drive to an other. Afterwards, it was fine again, too.

This is why I suspect the hanging comes from Shareaza requesting read/write accesses on the HDD and waiting for them. Like this, some thread(s) necessary for GUI refreshing is (are) locked until a read/write access is granted - freezing the GUI meanwhile.

The reason why the problems are bigger with BitTorrents than with other files of similar size is that torrents are splitted into much more small fragments while downloading; fragments that need to be written on different places of the disk - and thus requiring more read/write accesses to be granted.

Maybe we should implement download caching of some sort to reduce the number of read/write accesses necessary. Shareaza would store newly downloaded data in RAM and only synchronize with the files on disk each - for example - 20 seconds.

EDIT: Moved to development forum... thought it might be better located there...

Re: Shareaza hanging frequently while downloading

PostPosted: 06 Jun 2011 01:32
by ailurophobe
Like Downloads.SaveInterval (default 60s) or Downloads.BufferSize (default 80kB)?

Maybe the issue is that it flushes all buffers every 60 seconds instead of each buffer after 60 seconds? That would be easy to code and it would pretty much cause the problem you describe. Since you have Visual Studio maybe you could check?

You can try increasing save interval. That should make Shareaza use fewer and larger disk transactions.

Re: Shareaza hanging frequently while downloading

PostPosted: 06 Jun 2011 16:14
by old_death
At the moment, I am unable to debug Shareaza, because of Ryo's pre v2.5.5.0 compiling changes, which make important debug information files not being compatible with my system. Until this has changed, I'm sorry but I am unable to efficiently code on Shareaza...

Re: Shareaza hanging frequently while downloading

PostPosted: 07 Jun 2011 01:03
by ailurophobe
Really, I thought he fixed it already. Must have been some other project file update...

Re: Shareaza hanging frequently while downloading

PostPosted: 07 Jun 2011 23:21
by old_death
No, it was that VS2010 compile change update. It builds but prevents me from debugging the code...