Partage
  • Partager sur Facebook
  • Partager sur Twitter

energy consumption of a running application

    26 avril 2016 à 19:52:27

    i want to know the amount of energy that a running application consumes in a particular period of time, i found how to get all the running application from task manager in java but i didin't know how to calculate their energy consumption.
    thanks
    • Partager sur Facebook
    • Partager sur Twitter
    Anonyme
      26 avril 2016 à 20:32:19

      Hi,

      If you are on Linux, run your java application and look his CPU consumption with "top" bash command.

      • Partager sur Facebook
      • Partager sur Twitter
        26 avril 2016 à 20:49:03

        hello thanks for responding ,

        no i'm using windows and i want to get the total consumption of any application that i'm using and not just the cpu consumption 

        • Partager sur Facebook
        • Partager sur Twitter
        Anonyme
          26 avril 2016 à 21:04:27

          You're welcome ! :)

          Ohw... So, I don't know how to make that, sorry.

          • Partager sur Facebook
          • Partager sur Twitter
            28 avril 2016 à 10:21:57

            Hi,

            Have a look to jmc (Java Mission Control) which allow you to record all the consumption for a java application for a period. It is included in jdk1.8/bin but I'm not sure it's included on Windows... Maybe downloadable ?

            • Partager sur Facebook
            • Partager sur Twitter
              28 avril 2016 à 21:20:08

              hello 
              thank you for responding,

              is jmc record all the consumption for java applications only, cause i want to record the consumption of any applicationthat's running example word, skype and all

              • Partager sur Facebook
              • Partager sur Twitter
                29 avril 2016 à 9:32:20

                Oh... Then I have no idea sorry =/

                Btw you are on the Java's forum, maybe you should post something here : https://openclassrooms.com/forum/categorie/windows it's the Windows section ;)

                -
                Edité par BabC 29 avril 2016 à 9:33:49

                • Partager sur Facebook
                • Partager sur Twitter
                  29 avril 2016 à 21:24:24

                  Hi,

                  You can't know the real energy consumption of the applications on standard os and computer.

                  At best you can monitor application activity and use some formula that will give a good hint of it using statistics.

                  One of the reason is that the computer consumption will mostly depends of all the element hardware (and their age), the air temperature in the room, etc. The software activity will just influence a part of it (so theoretically, for a real estimation of energy consumption, you will have to know all computer elements with stats on their consumption according to activity).

                  By example some apps will use the hard drive intensely, other will use CPU, other will use the graphic or network card. Depending on the hard drive (SSD/HDD), the processor, the presence of "NVIDIA Optimus" or other energy consumption optimization (that can be software and/or hardware), the result will be completely different.

                  Moreover, even if no application is running, you computer still consume energy (and on some computer, the difference of consumption between full activity and no activity is not enormous).
                  So you will have to decide how you divide this base consumption between apps.

                  At last, applications on an operative system share common resource and thus have impact on one another. A memory consumption application won't be able to take into account every thing.
                  By example, if we imagine we have an app dedicated to energy consumption optimisation which stop the hard-drive when it's not used during a certain amount of time. A small app that just do a simple write on disk every 2mn may prevent the hard drive to be stop and thus be responsible of a lot of energy consumption.


                  And if you replace the writes by some reads, it's even more difficult to guess the energy consumption because of cache that may avoid to wake up the hard drive.

                  I think most windows apps you will be able to find that pretend to calculate energy consumption will not be accurate at all.

                  -
                  Edité par macaque 29 avril 2016 à 21:46:57

                  • Partager sur Facebook
                  • Partager sur Twitter
                    1 mai 2016 à 17:23:12

                    hi thank you so much for responding 

                    here is the thing actually i want to developpe an application that reduces the amount of energy of computers by monitoring the cpu load and the battery level and application consumption 

                    so if the level batterie is low and cpu load id high i'll detect the application that consumes a lot and tell the user to shut it down 

                    so according to you i won't be able to do that? and if so xhat can i do instead 

                    thank you 

                    • Partager sur Facebook
                    • Partager sur Twitter
                      2 mai 2016 à 22:22:25

                      Yes, if windows offer an API that allow you to know cpu consumption of running apps (which it probably does), you will be able to monitor CPU consumption.

                      And if an app more than 50% of CPU (on a significative period), it will be generally true that this app consumes a lot of energy, so you can try to tell the user to close it (but in most cases, this app will probably the one that the user want to use).

                      And if you monitor disk access too, you can also warn the user of application that use lots of IO even if they don't consume a lot of CPU.

                      What I was saying is that your application won't be able to give exact energy consumption, that doesn't mean it can not be useful in some ways.

                      In fact, if you just give information on instantaneous resource usage, I'm not sure your app will offer a real added value than native windows task manager and resource monitoring (I think in most case, the instruction to give to the user is simple : "close the apps you don't need now or in the next 15mn".)

                      But if your app run in background on long period of time (as you want to do), some users may be interested to see which of their apps consumed (even if your app will consume energy too...) and may discover they have an application that is a real energy consumer.

                      What will be very useful I think, will be to gather enough information on all the resource usage of all major applications (on different computers, different configurations, ..) and generate global stats on applications consumptions.
                      Then your application may be able to give useful advices by simply scanning the installed applications (by example by proposing to consider to replace an app by an other that offer the same service and consume less). And the information you have gathered can also be shown on a web site.

                      In any case java is not the best language for the part of your application that will collect resource usage, because the information  has too be collected from the operating system and java is mainly for "portable application" that won't depend of the os (and I don't think there is a portable way of knowing running application resource usage in native java language).

                      -
                      Edité par macaque 4 mai 2016 à 10:04:56

                      • Partager sur Facebook
                      • Partager sur Twitter
                        4 mai 2016 à 0:49:03

                        thank you so much for you're help; you've given me a lot to think about 
                        my application doesn't reduces the energy by closing the running application only, this is one of the things i wanted to accomplish .
                        you are right about java but i managed to do what i want to do using ms_dos commands with java  .  
                        thank you again.
                        • Partager sur Facebook
                        • Partager sur Twitter

                        energy consumption of a running application

                        × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
                        × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
                        • Editeur
                        • Markdown