How to find where pharo is killing processor power?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to find where pharo is killing processor power?

sergio_101

hey all.. my current pharo implementation is running super serious processor power, but it shouldn’t be doing much.


how would I go about tracking this inside the pharo image?

Thanks!



signature.asc (852 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to find where pharo is killing processor power?

Sven Van Caekenberghe-2
Are you using VNC ?

> On 16 Aug 2017, at 21:03, sergio ruiz <[hidden email]> wrote:
>
>
> hey all.. my current pharo implementation is running super serious processor power, but it shouldn’t be doing much.
>
> <Activity_Monitor__All_Processes__and_Pharo_image.jpg>
>
> how would I go about tracking this inside the pharo image?
>
> Thanks!
>
>
> ----
> peace,
> sergio
> photographer, journalist, visionary
>
> Public Key: http://bit.ly/29z9fG0
> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
> http://www.Village-Buzz.com
> http://www.ThoseOptimizeGuys.com
> http://www.coffee-black.com
> http://www.painlessfrugality.com
> http://www.twitter.com/sergio_101
> http://www.facebook.com/sergio101


Reply | Threaded
Open this post in threaded view
|

Re: How to find where pharo is killing processor power?

kilon.alios
In reply to this post by sergio_101
Are you aware of the profile tools inside Pharo ? They capture execution and offer detailed analysis of how much time is spent on each task. One of it can be found in World Menu -> Tools -> Time Profiler

Generally speaking a while loop that runs all the time without any kind of delays is a very popular way to consume 100%. Even if the while loop does nothing it will still consume %100 because even executing an empty loops has costs. Two solution is inserting a delay in the loop so the loop have to wait for 1 millisecond or less depending your demands or just make sure the loop has a very specific condition so it executes only when you need to. 

On Wed, Aug 16, 2017 at 10:04 PM sergio ruiz <[hidden email]> wrote:

hey all.. my current pharo implementation is running super serious processor power, but it shouldn’t be doing much.

Activity_Monitor__All_Processes__and_Pharo_image.jpg

how would I go about tracking this inside the pharo image?

Thanks!


Reply | Threaded
Open this post in threaded view
|

Re: How to find where pharo is killing processor power?

Ben Coman


On Thu, Aug 17, 2017 at 7:53 PM, Dimitris Chloupis <[hidden email]> wrote:
Are you aware of the profile tools inside Pharo ? They capture execution and offer detailed analysis of how much time is spent on each task. One of it can be found in World Menu -> Tools -> Time Profiler

Thats good for a normal behaving process, but I'm not sure it helps identify a currently-misbehaving process. 
A (virtual)CPU % could be useful addition to Process Browser.

cheers -ben  
 

Generally speaking a while loop that runs all the time without any kind of delays is a very popular way to consume 100%. Even if the while loop does nothing it will still consume %100 because even executing an empty loops has costs. Two solution is inserting a delay in the loop so the loop have to wait for 1 millisecond or less depending your demands or just make sure the loop has a very specific condition so it executes only when you need to. 

On Wed, Aug 16, 2017 at 10:04 PM sergio ruiz <[hidden email]> wrote:

hey all.. my current pharo implementation is running super serious processor power, but it shouldn’t be doing much.

Activity_Monitor__All_Processes__and_Pharo_image.jpg

how would I go about tracking this inside the pharo image?

Thanks!



Reply | Threaded
Open this post in threaded view
|

Re: How to find where pharo is killing processor power?

kilon.alios

it depends what you mean

if you talk about Pharo code then those tools should be enough , unless it freezes Pharo (a 100% consumption does not necessarily imply a freeze)

if you talk about the Pharo VM itself then you will need to use one of the countless profilers that exist for C/C++ . Some OSes come included with them. MacOS which what I am using can sample a running process and tell you exactly which function/method consumes how much CPU. 

Obviously more specialised tools can be even more of an assistance like Valgrind


But then it will require knowledge of the Pharo VM internals.

if it freezes pharo and you know its pharo code then its a matter of taking a look at changes file and testing on a new image one change at the time until you identify the code that causes the slow down. 

At least that is what I have done one time I really messed up Morphic draw loop and froze my image. 

On Sat, Aug 19, 2017 at 2:27 PM Ben Coman <[hidden email]> wrote:
On Thu, Aug 17, 2017 at 7:53 PM, Dimitris Chloupis <[hidden email]> wrote:
Are you aware of the profile tools inside Pharo ? They capture execution and offer detailed analysis of how much time is spent on each task. One of it can be found in World Menu -> Tools -> Time Profiler

Thats good for a normal behaving process, but I'm not sure it helps identify a currently-misbehaving process. 
A (virtual)CPU % could be useful addition to Process Browser.

cheers -ben  
 

Generally speaking a while loop that runs all the time without any kind of delays is a very popular way to consume 100%. Even if the while loop does nothing it will still consume %100 because even executing an empty loops has costs. Two solution is inserting a delay in the loop so the loop have to wait for 1 millisecond or less depending your demands or just make sure the loop has a very specific condition so it executes only when you need to. 

On Wed, Aug 16, 2017 at 10:04 PM sergio ruiz <[hidden email]> wrote:

hey all.. my current pharo implementation is running super serious processor power, but it shouldn’t be doing much.

Activity_Monitor__All_Processes__and_Pharo_image.jpg

how would I go about tracking this inside the pharo image?

Thanks!