housebot becomes very slow

Having problems? Maybe others have had the same problem too. Post HouseBot technical issues here.
Post Reply
peter
Member
Posts: 35
Joined: Wed May 31, 2006 3:51 am
Location: Berlin , GER

housebot becomes very slow

Post by peter »

has anybody seen this: the housebot.exe creates a lot of threads for some reason and it becomes very slow.
Normally my application runs with 38 threads and works fine. After a while ( may be some hours) it begins to creating additional threads up to 1.000 !! blocking the whole computer. :?:

I've tested with 2.31 as well as 2.22
The server is driving a plugin written by myself. The plugin is for dealing with a hardware connected via UDP protocol. (very simple). The plugin does not create any threads while running.

Further devices are System Time, Sleeptimers, Winamp-device and Null-devices.

May be my plugin is responsible for this strange behavior. But I don't know what can cause creating so many threads.
ScottBot
Site Admin
Posts: 2787
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

Each device runs in it's own thread and can create additional threads if it needs. The devices you listed each will run in a single thread, so they shouldn't be the issue. Hardware Interfaces are the same.

Scripts (Script Device) are also each executed in their own thread, but will terminate the thread when complete.

When a Task executes, it runs in it's own thread and terminates the thread when complete. You shouldn't be able to start the same Task until it has completed, so I don't see how that could amass the large thread count.

Not sure where to look, but maybe that will give you an idea of where to start.
Scott
peter
Member
Posts: 35
Joined: Wed May 31, 2006 3:51 am
Location: Berlin , GER

Post by peter »

Hi Scott,

I've tested a little with tasks and Null-devices.
When you build a circle relation for instance task A tests property a and turns property b, task B tests property b and turns property a, I watched sometimes exactly what I described. The task count increases and the system becomes blocked.

In other cases the housebot server disappears after a while.

So, obviously I have built something like a circle relation with my tasks (accidently :? )

Thanks for your hints

Update 06/01/06:
Evidently the problem is caused by triggering tasks too heavy. A selfwritten temperature-device called the ChangeRequestCompleted function with a pretty high frequency always with the same value, which is actually not necessary. Several tasks were still triggered by this (not) changing property.
Avoiding to call the ChangeRequestCompleted with same value let the problem disappear.

I guess any problem with starting tasks twice inside the server.
peter
Member
Posts: 35
Joined: Wed May 31, 2006 3:51 am
Location: Berlin , GER

Post by peter »

Scott,
occasionally my Housebot gets very slow. I posted this problem some months ago in the forum here. The attached picture shows the stack of one of these threads. Maybe you can see what part of the server creates the threads.

Thanks again
peter
Attachments
threads.jpg
threads.jpg (224.06 KiB) Viewed 1355 times
ScottBot
Site Admin
Posts: 2787
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

Peter,

Sorry I've taken so long to respond... kinda got lost in the shuffle.

A few questions for you.

What version of HouseBot is that stack trace from? I've looked into 2.31 and it's pointing to a rather unlikely spot.

Are all of the stack traces from the threads stopped at the same point?
Scott
peter
Member
Posts: 35
Joined: Wed May 31, 2006 3:51 am
Location: Berlin , GER

Post by peter »

I believe I know a little bit more. The suspicious threads are regular tasks. That I found by comparing the stacks with stacks when housebot behaves normally. I understood that tasks are separate threads but originally I thought that are waiting threads, waiting for any event to run. When a tasks becomes active a new thread is created and typically after a few milliseconds it calls the ThreadExit call. This ThreadExit was missing when I had the problem, so the tasks-threads kept alive.
3 o'clock in the morning the virus scanner was scheduled to run and at this time the housebot began sometimes to fail to call the ThreadExit for the tasks. Since I removed the virus scanner I do not have the problem any longer.
Post Reply