Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Contributor
aditya_impro
Posts: 3
Registered: ‎04-13-2011
My Device: 9550 Torch

How to get memory and CPU consumption by a running process

Hi All,

 

I am a new bee in BB development and I am trying to get the memory and CPU usage figures of a running application from my application.

Can anybody help me out with this? is it possible to get such information for a particular application/process in blackberry ?

 

Any tip will be a great  help.

 

Thanks,

Aditya.

Please use plain text.
Developer
dx22
Posts: 402
Registered: ‎11-26-2010
My Device: Torch

Re: How to get memory and CPU consumption by a running process

The Memory class can give you info about the overall system resources usage.

I am not aware of anything which could give you info about a particular application.

----------------------------------------------------------------------
Press the button to give kudos if I helped you :smileyhappy:
Please use plain text.
New Contributor
aditya_impro
Posts: 3
Registered: ‎04-13-2011
My Device: 9550 Torch

Re: How to get memory and CPU consumption by a running process

Thanks for the reply dx22,

but i need the information for a particular process or application.

Please use plain text.
Developer
dx22
Posts: 402
Registered: ‎11-26-2010
My Device: Torch

Re: How to get memory and CPU consumption by a running process

Well I found how to get the process id for application but no more than that.

 

Does your application really need to know the resources used by another application or you just want to keep track whether there are enough resources? If it is the latter case you might find useful something from the net.rim.device.api.lowmemory package.

----------------------------------------------------------------------
Press the button to give kudos if I helped you :smileyhappy:
Please use plain text.
Developer
sonicboomboy
Posts: 466
Registered: ‎03-04-2009
My Device: 8520

Re: How to get memory and CPU consumption by a running process

you might consider using also the following methods:

Runtime.getRuntime().freeMemory() ,Runtime.getRuntime().totalMemory(),Thread.activeCount() .

Got resolved! Press kudo icon!
Please use plain text.
Developer
peter_strange
Posts: 19,609
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to get memory and CPU consumption by a running process

Just to confirm that I too am not aware of any way of finding out the memory consumption or CPU consumption of a specific application. 

 

During development I generally profile anything that I think might be resource intensive, to be sure it won't impact the BB processing too much.

Please use plain text.
New Contributor
aditya_impro
Posts: 3
Registered: ‎04-13-2011
My Device: 9550 Torch

Re: How to get memory and CPU consumption by a running process

Thanks everyone for your replies.

 

I guess it wont be possible from a different application to retrieve such information about any particular application.

 

So, is there a way to get these figures for an application using the application code itself..i mean from inside the application...? can i get this information for -say , the current screen ?

 

Regards,

Aditya.

Please use plain text.
Developer
peter_strange
Posts: 19,609
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to get memory and CPU consumption by a running process

Not that I am aware off

Please use plain text.