Profiling WebSphere with hprof for CPU SAMPLES output









up vote
1
down vote

favorite












I'm trying to profile WebSphere using hprof over IBM stack (J9 JVM on AIX / Linux). Specifically, I'm interested in the CPU samples output from hprof, and particularly, the startup time (from the time WS is started until it is "ready for business").



The problem is, I can't get the CPU samples output in the hprof result file.



I'm using the following JVM argument for configuring hprof: -Xrunhprof:cpu=samples,file=path-to-hprof.txt, for dumping hprof output in ASCII format. According to the generated hprof output, the CPU SAMPLES output is only generated at program exit:




HEAP DUMP, SITES, CPU SAMPLES|TIME and MONITOR DUMP|TIME records are generated
at program exit.




So, for shutting down WebSphere gracefully after it successfully started, I'm using the stopServer.sh script, and expecting the CPU SAMPLES output to be present in the result java.hprof.txt file after shutdown completes, but it isn't.



What am I doing wrong? Is there a better method for using hprof with WebSphere and generating CPU profiling output? Any help will be much appreciated!



Edit: I'm running WebSphere version 8.0.0.11 over IBM J9 VM (build 2.6, JRE 1.6.0 20150619_253846) on RHEL 7.5.



P.S.: I also looked for a way for closing WS from the management console GUI, but couldn't find any.



P.P.S.: In the meanwhile I'm using the very nice jvmtop tool with the --profile <pid> option, but that provides only partial insight, and as opposed to hprof, has to be attached on the fly, so some parts of the execution are lost.










share|improve this question























  • Can you check if there's anything in native_stderr.log and native_stdout.log?
    – kgibm
    Nov 12 at 15:47










  • Also, for J9, I recommend the sampling profiler Health Center that ships with IBM Java instead of HPROF: publib.boulder.ibm.com/httpserv/cookbook/…
    – kgibm
    Nov 12 at 15:48










  • Thanks for your comments, @kgibm! Nothing that pops up in native_stderr.log and native_stdout.log but the standard WS outputs.
    – valiano
    Nov 12 at 15:51










  • Note, I'm primarily interested in a console profiler - perhaps I should have highlighted that in my question. But surely I'll give a closer look on the IBM health center sampling profiler.
    – valiano
    Nov 12 at 15:54






  • 1




    Roger that, @kgibm... Thank you very much for your kind help!
    – valiano
    Nov 12 at 20:43














up vote
1
down vote

favorite












I'm trying to profile WebSphere using hprof over IBM stack (J9 JVM on AIX / Linux). Specifically, I'm interested in the CPU samples output from hprof, and particularly, the startup time (from the time WS is started until it is "ready for business").



The problem is, I can't get the CPU samples output in the hprof result file.



I'm using the following JVM argument for configuring hprof: -Xrunhprof:cpu=samples,file=path-to-hprof.txt, for dumping hprof output in ASCII format. According to the generated hprof output, the CPU SAMPLES output is only generated at program exit:




HEAP DUMP, SITES, CPU SAMPLES|TIME and MONITOR DUMP|TIME records are generated
at program exit.




So, for shutting down WebSphere gracefully after it successfully started, I'm using the stopServer.sh script, and expecting the CPU SAMPLES output to be present in the result java.hprof.txt file after shutdown completes, but it isn't.



What am I doing wrong? Is there a better method for using hprof with WebSphere and generating CPU profiling output? Any help will be much appreciated!



Edit: I'm running WebSphere version 8.0.0.11 over IBM J9 VM (build 2.6, JRE 1.6.0 20150619_253846) on RHEL 7.5.



P.S.: I also looked for a way for closing WS from the management console GUI, but couldn't find any.



P.P.S.: In the meanwhile I'm using the very nice jvmtop tool with the --profile <pid> option, but that provides only partial insight, and as opposed to hprof, has to be attached on the fly, so some parts of the execution are lost.










share|improve this question























  • Can you check if there's anything in native_stderr.log and native_stdout.log?
    – kgibm
    Nov 12 at 15:47










  • Also, for J9, I recommend the sampling profiler Health Center that ships with IBM Java instead of HPROF: publib.boulder.ibm.com/httpserv/cookbook/…
    – kgibm
    Nov 12 at 15:48










  • Thanks for your comments, @kgibm! Nothing that pops up in native_stderr.log and native_stdout.log but the standard WS outputs.
    – valiano
    Nov 12 at 15:51










  • Note, I'm primarily interested in a console profiler - perhaps I should have highlighted that in my question. But surely I'll give a closer look on the IBM health center sampling profiler.
    – valiano
    Nov 12 at 15:54






  • 1




    Roger that, @kgibm... Thank you very much for your kind help!
    – valiano
    Nov 12 at 20:43












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I'm trying to profile WebSphere using hprof over IBM stack (J9 JVM on AIX / Linux). Specifically, I'm interested in the CPU samples output from hprof, and particularly, the startup time (from the time WS is started until it is "ready for business").



The problem is, I can't get the CPU samples output in the hprof result file.



I'm using the following JVM argument for configuring hprof: -Xrunhprof:cpu=samples,file=path-to-hprof.txt, for dumping hprof output in ASCII format. According to the generated hprof output, the CPU SAMPLES output is only generated at program exit:




HEAP DUMP, SITES, CPU SAMPLES|TIME and MONITOR DUMP|TIME records are generated
at program exit.




So, for shutting down WebSphere gracefully after it successfully started, I'm using the stopServer.sh script, and expecting the CPU SAMPLES output to be present in the result java.hprof.txt file after shutdown completes, but it isn't.



What am I doing wrong? Is there a better method for using hprof with WebSphere and generating CPU profiling output? Any help will be much appreciated!



Edit: I'm running WebSphere version 8.0.0.11 over IBM J9 VM (build 2.6, JRE 1.6.0 20150619_253846) on RHEL 7.5.



P.S.: I also looked for a way for closing WS from the management console GUI, but couldn't find any.



P.P.S.: In the meanwhile I'm using the very nice jvmtop tool with the --profile <pid> option, but that provides only partial insight, and as opposed to hprof, has to be attached on the fly, so some parts of the execution are lost.










share|improve this question















I'm trying to profile WebSphere using hprof over IBM stack (J9 JVM on AIX / Linux). Specifically, I'm interested in the CPU samples output from hprof, and particularly, the startup time (from the time WS is started until it is "ready for business").



The problem is, I can't get the CPU samples output in the hprof result file.



I'm using the following JVM argument for configuring hprof: -Xrunhprof:cpu=samples,file=path-to-hprof.txt, for dumping hprof output in ASCII format. According to the generated hprof output, the CPU SAMPLES output is only generated at program exit:




HEAP DUMP, SITES, CPU SAMPLES|TIME and MONITOR DUMP|TIME records are generated
at program exit.




So, for shutting down WebSphere gracefully after it successfully started, I'm using the stopServer.sh script, and expecting the CPU SAMPLES output to be present in the result java.hprof.txt file after shutdown completes, but it isn't.



What am I doing wrong? Is there a better method for using hprof with WebSphere and generating CPU profiling output? Any help will be much appreciated!



Edit: I'm running WebSphere version 8.0.0.11 over IBM J9 VM (build 2.6, JRE 1.6.0 20150619_253846) on RHEL 7.5.



P.S.: I also looked for a way for closing WS from the management console GUI, but couldn't find any.



P.P.S.: In the meanwhile I'm using the very nice jvmtop tool with the --profile <pid> option, but that provides only partial insight, and as opposed to hprof, has to be attached on the fly, so some parts of the execution are lost.







java jvm websphere hprof j9






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 13 at 13:50

























asked Nov 11 at 11:46









valiano

2,92021130




2,92021130











  • Can you check if there's anything in native_stderr.log and native_stdout.log?
    – kgibm
    Nov 12 at 15:47










  • Also, for J9, I recommend the sampling profiler Health Center that ships with IBM Java instead of HPROF: publib.boulder.ibm.com/httpserv/cookbook/…
    – kgibm
    Nov 12 at 15:48










  • Thanks for your comments, @kgibm! Nothing that pops up in native_stderr.log and native_stdout.log but the standard WS outputs.
    – valiano
    Nov 12 at 15:51










  • Note, I'm primarily interested in a console profiler - perhaps I should have highlighted that in my question. But surely I'll give a closer look on the IBM health center sampling profiler.
    – valiano
    Nov 12 at 15:54






  • 1




    Roger that, @kgibm... Thank you very much for your kind help!
    – valiano
    Nov 12 at 20:43
















  • Can you check if there's anything in native_stderr.log and native_stdout.log?
    – kgibm
    Nov 12 at 15:47










  • Also, for J9, I recommend the sampling profiler Health Center that ships with IBM Java instead of HPROF: publib.boulder.ibm.com/httpserv/cookbook/…
    – kgibm
    Nov 12 at 15:48










  • Thanks for your comments, @kgibm! Nothing that pops up in native_stderr.log and native_stdout.log but the standard WS outputs.
    – valiano
    Nov 12 at 15:51










  • Note, I'm primarily interested in a console profiler - perhaps I should have highlighted that in my question. But surely I'll give a closer look on the IBM health center sampling profiler.
    – valiano
    Nov 12 at 15:54






  • 1




    Roger that, @kgibm... Thank you very much for your kind help!
    – valiano
    Nov 12 at 20:43















Can you check if there's anything in native_stderr.log and native_stdout.log?
– kgibm
Nov 12 at 15:47




Can you check if there's anything in native_stderr.log and native_stdout.log?
– kgibm
Nov 12 at 15:47












Also, for J9, I recommend the sampling profiler Health Center that ships with IBM Java instead of HPROF: publib.boulder.ibm.com/httpserv/cookbook/…
– kgibm
Nov 12 at 15:48




Also, for J9, I recommend the sampling profiler Health Center that ships with IBM Java instead of HPROF: publib.boulder.ibm.com/httpserv/cookbook/…
– kgibm
Nov 12 at 15:48












Thanks for your comments, @kgibm! Nothing that pops up in native_stderr.log and native_stdout.log but the standard WS outputs.
– valiano
Nov 12 at 15:51




Thanks for your comments, @kgibm! Nothing that pops up in native_stderr.log and native_stdout.log but the standard WS outputs.
– valiano
Nov 12 at 15:51












Note, I'm primarily interested in a console profiler - perhaps I should have highlighted that in my question. But surely I'll give a closer look on the IBM health center sampling profiler.
– valiano
Nov 12 at 15:54




Note, I'm primarily interested in a console profiler - perhaps I should have highlighted that in my question. But surely I'll give a closer look on the IBM health center sampling profiler.
– valiano
Nov 12 at 15:54




1




1




Roger that, @kgibm... Thank you very much for your kind help!
– valiano
Nov 12 at 20:43




Roger that, @kgibm... Thank you very much for your kind help!
– valiano
Nov 12 at 20:43












1 Answer
1






active

oldest

votes

















up vote
0
down vote



accepted










Thanks to @kgibm's helpful hints, I realized I was on the right track, and went back the next day to try again. Surprisingly, this time, it worked! The hprof file was generated with the expected WebSphere CPU samples output.



I kept experimenting to figure out what I got wrong in the first place. Here's what I think has happened:



  1. At first, I had a couple of native agents specified in WebSphere JVM arguments. The combination of these agents caused WS to run much slower. When I killed WS, there were a few seconds between the Server server1 stop completed message was printed and hprof.txt being completely written. I believe I was too quick to view hprof.txt, before the CPU samples output was actually written.


  2. Then, for troubleshooting this issue, I added the doe=n parameter to the hprof argument. doe stands for Dump On Exit, and defaults to y. Only later I realized that this is probably wrong, since as quoted, CPU samples output is only generated at exit.


I think that these two issues together contributed to my confusion, so when I started clean, everything was OK.



Perhaps it is worth clarifying in hprof documentation that the doe=n option is conflicting with cpu=samples, and possibly with the other options that write on exit as well (I didn't see such an indication in the docs, but it's possible I've missed it).






share|improve this answer




















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53248429%2fprofiling-websphere-with-hprof-for-cpu-samples-output%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote



    accepted










    Thanks to @kgibm's helpful hints, I realized I was on the right track, and went back the next day to try again. Surprisingly, this time, it worked! The hprof file was generated with the expected WebSphere CPU samples output.



    I kept experimenting to figure out what I got wrong in the first place. Here's what I think has happened:



    1. At first, I had a couple of native agents specified in WebSphere JVM arguments. The combination of these agents caused WS to run much slower. When I killed WS, there were a few seconds between the Server server1 stop completed message was printed and hprof.txt being completely written. I believe I was too quick to view hprof.txt, before the CPU samples output was actually written.


    2. Then, for troubleshooting this issue, I added the doe=n parameter to the hprof argument. doe stands for Dump On Exit, and defaults to y. Only later I realized that this is probably wrong, since as quoted, CPU samples output is only generated at exit.


    I think that these two issues together contributed to my confusion, so when I started clean, everything was OK.



    Perhaps it is worth clarifying in hprof documentation that the doe=n option is conflicting with cpu=samples, and possibly with the other options that write on exit as well (I didn't see such an indication in the docs, but it's possible I've missed it).






    share|improve this answer
























      up vote
      0
      down vote



      accepted










      Thanks to @kgibm's helpful hints, I realized I was on the right track, and went back the next day to try again. Surprisingly, this time, it worked! The hprof file was generated with the expected WebSphere CPU samples output.



      I kept experimenting to figure out what I got wrong in the first place. Here's what I think has happened:



      1. At first, I had a couple of native agents specified in WebSphere JVM arguments. The combination of these agents caused WS to run much slower. When I killed WS, there were a few seconds between the Server server1 stop completed message was printed and hprof.txt being completely written. I believe I was too quick to view hprof.txt, before the CPU samples output was actually written.


      2. Then, for troubleshooting this issue, I added the doe=n parameter to the hprof argument. doe stands for Dump On Exit, and defaults to y. Only later I realized that this is probably wrong, since as quoted, CPU samples output is only generated at exit.


      I think that these two issues together contributed to my confusion, so when I started clean, everything was OK.



      Perhaps it is worth clarifying in hprof documentation that the doe=n option is conflicting with cpu=samples, and possibly with the other options that write on exit as well (I didn't see such an indication in the docs, but it's possible I've missed it).






      share|improve this answer






















        up vote
        0
        down vote



        accepted







        up vote
        0
        down vote



        accepted






        Thanks to @kgibm's helpful hints, I realized I was on the right track, and went back the next day to try again. Surprisingly, this time, it worked! The hprof file was generated with the expected WebSphere CPU samples output.



        I kept experimenting to figure out what I got wrong in the first place. Here's what I think has happened:



        1. At first, I had a couple of native agents specified in WebSphere JVM arguments. The combination of these agents caused WS to run much slower. When I killed WS, there were a few seconds between the Server server1 stop completed message was printed and hprof.txt being completely written. I believe I was too quick to view hprof.txt, before the CPU samples output was actually written.


        2. Then, for troubleshooting this issue, I added the doe=n parameter to the hprof argument. doe stands for Dump On Exit, and defaults to y. Only later I realized that this is probably wrong, since as quoted, CPU samples output is only generated at exit.


        I think that these two issues together contributed to my confusion, so when I started clean, everything was OK.



        Perhaps it is worth clarifying in hprof documentation that the doe=n option is conflicting with cpu=samples, and possibly with the other options that write on exit as well (I didn't see such an indication in the docs, but it's possible I've missed it).






        share|improve this answer












        Thanks to @kgibm's helpful hints, I realized I was on the right track, and went back the next day to try again. Surprisingly, this time, it worked! The hprof file was generated with the expected WebSphere CPU samples output.



        I kept experimenting to figure out what I got wrong in the first place. Here's what I think has happened:



        1. At first, I had a couple of native agents specified in WebSphere JVM arguments. The combination of these agents caused WS to run much slower. When I killed WS, there were a few seconds between the Server server1 stop completed message was printed and hprof.txt being completely written. I believe I was too quick to view hprof.txt, before the CPU samples output was actually written.


        2. Then, for troubleshooting this issue, I added the doe=n parameter to the hprof argument. doe stands for Dump On Exit, and defaults to y. Only later I realized that this is probably wrong, since as quoted, CPU samples output is only generated at exit.


        I think that these two issues together contributed to my confusion, so when I started clean, everything was OK.



        Perhaps it is worth clarifying in hprof documentation that the doe=n option is conflicting with cpu=samples, and possibly with the other options that write on exit as well (I didn't see such an indication in the docs, but it's possible I've missed it).







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 17 at 20:45









        valiano

        2,92021130




        2,92021130



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53248429%2fprofiling-websphere-with-hprof-for-cpu-samples-output%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            這個網誌中的熱門文章

            Barbados

            How to read a connectionString WITH PROVIDER in .NET Core?

            Node.js Script on GitHub Pages or Amazon S3