Comment 12 for bug 919424

Revision history for this message
maksis (maksis) wrote : Re: /rebuild does not update HashData

Rebuild won't delete any trees that are used at some point during the session. That's seems to be an intentional design choice that simplifies the code.

While I'm not sure if the behavior described in this post is causing any *real* problems that would justify complicating the code, there's a bigger problem related to this design. When an user moves a file from one shared directory to another one, the tree still stays shared. Since the client stores each hashed file path separately, the client will never delete the old paths from the database as long as the tree stays shared in another location. DC++ keeps all file paths in memory, so this will slowly keep on increasing the memory usage and the start-up speed.

I've changed the hash database format in AirDC++ 2.50, which allows comparing each path in hash database with the share. When I gave the new version to an user who had been experiencing various performance issues, it revealed that he had more than 16 million unused file entries in the database. This had increased his memory usage by several gigabytes (it used to be 5-8 gigabytes with the old version) and the size of his HashIndex.xml was more than 4 gigabytes. Of course this also means that he had moved his files quite a lot because he was "only" sharing 5 million files, but he had probably been using the same database since the time when hashing support was implemented.