12-02-2012 01:59 AM
I've just figured out that my own program is using alot of CPU (>40) and memory (~10) when it is running. In main page, I attach all of qml, file picker, music player, q timer. I think that is the reason. Is it right? And how i can reduce the cpu and memory usage?
12-04-2012 10:34 AM
12-04-2012 11:35 AM
12-04-2012 09:37 PM
I had some system sounds attached to one of my pages, and that caused a 50% CPU load, that wouldn't stop until the app closed.
Not sure if it was something I had done wrong, but once I removed it, the CPU would act normally.
At minimum, if you are worried about it, segregate each seperate qml page and see what load they use.
12-04-2012 11:01 PM
Thanks all you guy. Because of the system sounds, cpu is always >40.
12-05-2012 12:12 AM
12-05-2012 12:52 AM - edited 12-05-2012 12:53 AM
At the beginning I had:
import bb.multimedia 1.0
and as an attached object:
attachedObject: [
SystemSound{
id: fstSound
sound: {
SystemSound.DeviceUntetherEvent
}
}
]
I just added it back in to my main project, and without calling it in the file the CPU usage went back up to 50% and stayed there.
I guess I should put that up as a bug?
12-05-2012 01:27 AM
how are you monitoring cpu usage or memory usage? are you using the onscreen swipe debug info or the QDE's QNX System Information perspective?
12-05-2012 08:53 AM
Wow, that sure looks like a nasty bug. Yes, please report it!
I just confirmed it too, with code from the documentation at https://developer.blackberry.com/cascades/document
Merely adding the SystemSound definition to my main.qml and running the app, even though the sound never plays, results in "CPU 43 0 0" up to "CPU 50 0 0" appearing in the diagnostic overlay. I believe that means one core is sometimes getting pegged at 100% CPU.
Here's the log output possibly associated with this, though it gives no hint (at least to me) that there's a problem.
08:50:32.287 <appname> default 9000 START 1 SystemSoundPrivate::SystemSoundPrivate
08:50:32.287 <appname> default 9000 => END 1 ( 0 ms):
08:50:32.287 <appname> default 9000 START 1 SystemSound::setSound
08:50:32.287 <appname> default 9000 START 1 SystemSoundPrivate::setSound
08:50:32.287 <appname> default 9000 START 1 multimedia::toString
08:50:32.287 <appname> default 9000 multimedia::toString: sound=3
08:50:32.287 <appname> default 9000 => END 1 ( 0 ms):
08:50:32.287 <appname> default 9000 SystemSoundPrivate::setSound: sound="event_camera_shutter"
08:50:32.287 <appname> default 9000 START 1 SystemSoundPrivate::send
08:50:32.287 <appname> default 9000 SystemSoundPrivate::send: sound=3, msg="prepare_sound"
08:50:32.287 <appname> default 9000 START 1 multimedia::toString
08:50:32.287 <appname> default 9000 multimedia::toString: sound=3
08:50:32.287 <appname> default 9000 => END 1 ( 0 ms):
08:50:32.287 <appname> default 9000 SystemSoundPrivate::send: QMap(("dat", QVariant(QVariantMap,
QMap(("sound", QVariant(QString, "event_camera_shutter") ) ) ) ) ( "id" , QVariant(QString, "0") )
( "msg" , QVariant(QString, "prepare_sound") ) )
08:50:32.287 <appname> default 9000 => END 1 ( 1 ms):
08:50:32.287 <appname> default 9000 => END 1 ( 1 ms):
08:50:32.287 <appname> default 9000 => END 1 ( 1 ms):
12-05-2012 08:59 AM