[Uml-devel] High CPU load even in idle state ( hidden, no action is running )

Achim Spangler Achim.Spangler at mnet-online.de
Wed Jul 21 10:19:05 UTC 2004


Hi,
I found the reason for the high CPU load - and fixed it.

Detect:
Simply check with kdbg where the operation is currently, if the program is 
interrupted in invisible-state.

=> always something with Qt update events
As I have this high load only with a lot of diagrams, the QCanvas and 
QCanvasView classes were suspectible.

Solution:
Switch the update OFF for the QCanvas of a hidden diagram
( QT-Doc states for QCanvas::setUpdatePeriod()
  "If ms is less than 0 automatic updating will be stopped. " ),
and switch it back to ON on show event.

Result:
Now even my large project is at a very low CPU load!

Now the work with my project is again smart and quick.

##
Changes:
UMLView::init() :
---------------------
Switch update OFF, as this is started by show event.
( Change call of "canvas() -> setUpdatePeriod( 20 );"
   to "canvas() -> setUpdatePeriod( -1 );" )


UMLView::showEvent(QShowEvent* /*se*/) :
----------------------------------------------------------
Start update again with the well working rate of 20msec.
Call "canvas() -> setUpdatePeriod( 20 );" immediately after 
"canvas()->setDoubleBuffering( true );"


UMLView::hideEvent(QHideEvent* /*he*/) :
--------------------------------------------------------
Stop update again with "-1" as update rate.
Call "canvas() -> setUpdatePeriod( -1 );" immediately after 
"canvas()->setDoubleBuffering( false );"


Bye,
Achim

Am Mittwoch, 21. Juli 2004 18:23 schrieb Achim Spangler:
> Hi,
> as my project grew some more, I have a very high CPU load even in idle
> state ( means: no action like save/load/print, no display, no editing, just
> keep alive while some other application in another workspace is active ).
>
> Has anybody an idea which function is regularly called, so that such a high
> load could happen?
>
> Does anybody know a tool, which could help me to detect the functions which
> are active at a specific time ( at best with percent of load ).
> Is there a better way than starting umbrello in kdbg and to use its tools?
>
> Important side node:
> The memory resources are acceptable medium ( total less than 300MB ).
> Also the X11 memory resources are low.
>
>
> Bye,
> Achim
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by BEA Weblogic Workshop
> FREE Java Enterprise J2EE developer tools!
> Get your free copy of BEA WebLogic Workshop 8.1 today.
> http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
> _______________________________________________
> Uml-devel mailing list
> umbrello-devel at kde.org
> https://mail.kde.org/mailman/listinfo/umbrello-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ReduceCpuLoad.diff
Type: text/x-diff
Size: 1868 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/umbrello-devel/attachments/20040721/b0582bf1/attachment.bin>


More information about the umbrello-devel mailing list