I'm writing a program that uses some third-party libraries. I've noticed that my program's memory and cpu useage increases with time. The CPU goes from 1-2% to 70% overnight and the memory goes from 2% to something like 15%. I've run valgrind and except for the usual whine about Qt not freeing memory i'm not getting any warnings about the code i've written. The third-party libraries i'm using aren't discoverable.

Could the problem be caused by events being placed on the event queue faster than they can be processed? The increasing processing of events would explain the cpu useage and the growing queue would explain the increase in memory. To test my theory i'd like to see the size of the event queue. Is there any way to do this? Calling QCoreApplication::hasPendingEvents() doesn't really tell me what i want to know since i need to see that the queue increases with size over time and in correlation to the increase in cpu and memory useage.

Thanks in advance!