Submitted by Anonymous on Sun, 12/16/2001 - 18:59. Developers
Hi!
I am currently working with a multithreaded app using one thread for handling user events,
one thread for reading a socket on wich ~300 bytes of data arrives at 30 Hz and a third
thread handling the updating of some windows displaying the data on the socket.
This works well when the app has runned for only a few minutes, but after some 20 minutes or so,
when moving the mouse onto one of the open windows, the CPU load boosts up to a 100 percent
for a few seconds. As time passes this becomes worse until the CPU stays at a 100 percent for 10 seconds
or so when moving the mouse (and thereby giving focus to the window).
Eventually the app crashes. I know that there are some memory leaks in the updating functions in my
code, wich causes the process memory size to grow, but this hardly explains the strange CPU load
behaviour when giving focus to another window?
Any clues or tips?
/Osborn Conning, JA Development, Norrk?ping, SWEDEN
Memory leaks could explain this -- if the server is still single-threaded, as the standard server (still) is. Your poor CPU has to switch contexts between the two processes, and that can be expensive if your application has grown large.
You should be able to track where the crash is, which will give you a clue.