meta data for this page
  •  

This is an old revision of the document!


Solutions for PeerHood Problems

See development changes procedure.

Memory consumption

Problem description

PeerHood did reserve vast amount of (virtual) memory when started, ~21 MB with bluetooth plugin only (~44 MB when using WLAN and bluetooth) when only the daemon was running. The testing of memory consumption was performed for this reason to find out what uses or reserves that memory. First test and second test indicated that the memory was only reserved for some purpose while only small portion of it was used. With third test the reason was found: pthread library does reserve a big memory space for each thread when thread is started, the size of the memory space is the same as the default stack size in operating system (see testing)

Problem solution

Solution to this was to reduce the stack size, it can be done by setting a stack size for each thread in program code. See solution on the memory analysis pages.

THIS ISN'T YET IMPLEMENTED INTO THE CODE

WLAN plugin

Problem description

  1. If plugin exists and it is loaded PeerHood daemon segfaults if there is no specified WLAN-interface up and running. This happens only when starting the daemon. - julaakko
  2. WLAN plugin stops at first write error in WLANPlugin::InquiryThread. There should be at least some tolerance for failures. - julaakko

Problem solution

  1. Fixed in Maemo with listener, could be solved by creating a listener for WLAN state in Linux.
  2. Increased the tolerance to 10, defined in the WLANPlugin.cc. Plugin stops when amount of errors is reached, when there are same amount of successful writes the counter for errorous writes is zeroed. This is just a temporary solution, the plugin doesn't crash when e.g changing network (tolerance can be increased, it should be defined in config..).

Genral bugs in code

HasData() -function

The function reaches end of non-void function in error situations although it should return a boolean-value.

FIXED - julaakko