pixie icon indicating copy to clipboard operation
pixie copied to clipboard

Enable JAVA Profiling

Open RaymondSteenvoorden opened this issue 3 years ago • 10 comments

Hi,

I would like to do a feature request for java profiling. I think this would be a great addition to Pixie.

Kind regards,

RaymondSteenvoorden avatar May 27 '21 08:05 RaymondSteenvoorden

(Yaxiong from Pixie team) Sorry for late reply.

I think you are already played with the existing Pixie profiler: https://docs.pixielabs.ai/tutorials/profiler/ (it does not support Java application profiling, but only the JVM process).

Do you have example of Java profiling you have experienced from the other products available on the market?

Specific features/functionalities you like or dislike from those products would be very helpful as well.

yzhao1012 avatar Jul 02 '21 20:07 yzhao1012

IMHO async profiler is a very complete tool and it could be a good example: https://github.com/jvm-profiling-tools/async-profiler

Also Mission Control is very good: https://github.com/openjdk/jmc

antonmry avatar Nov 10 '21 11:11 antonmry

A quick update for those waiting for Java profiling. The feature is currently in alpha, and we plan to release it after some more testing!

oazizi000 avatar Mar 01 '22 18:03 oazizi000

Java support for Pixie's continuous profiler is now in beta. 🎉

A couple of notes about this beta feature:

  • Available for Pixie vizier version 0.10.22+. Learn how to identify and update your vizier version here.
  • Java support is a beta feature and must be manually enabled.
  • For best results, run Java applications with -XX:+PreserveFramePointer

Ways to get started:

  • Read the tutorial to see a demo of using Pixie’s continuous profiler to investigate a spike in CPU utilization caused by inefficient application code. Note: this tutorial features Golang application code.
  • Run the px/perf_flamegraph script in the Live UI to see a simple flamegraph that can be filtered by node, namespace, or pod.
  • Run the px/node script in the Live UI to see a flamegraph for a specific node alongside high-level application metrics (LET) and resource usage. Note: the flamegraph is at the bottom of the page.
  • Run the px/pod script in the Live UI to see a flamegraph for a specific pod alongside high-level application metrics (LET) and resource usage. Note: the flamegraph is at the bottom of the page.

htroisi avatar Apr 22 '22 20:04 htroisi

Even after enabling the -XX:+PreserveFramePointer I'm getting hexadecimal values, and not the method names.

Do I need to enable anything while compiling? We are using gradle to build the project

c3-pranjaysagar avatar Sep 14 '22 17:09 c3-pranjaysagar

@etep are there any known limitations with the Pixie profiler Java symbolization?

htroisi avatar Sep 14 '22 21:09 htroisi

Quick update for this thread: Support for Java profiling is now included by default in Pixie (no need to manually enable). 🎉

htroisi avatar Sep 14 '22 21:09 htroisi

Thanks @htroisi. I have been trying to test Pixie on Java application and for some reason I'm unable to get Java symbolization working?

Screen Shot 2022-09-14 at 6 00 02 PM Screen Shot 2022-09-14 at 5 59 30 PM

c3-pranjaysagar avatar Sep 15 '22 01:09 c3-pranjaysagar

@htroisi Confused, did I miss any steps?

c3-pranjaysagar avatar Sep 15 '22 01:09 c3-pranjaysagar

@c3-pranjaysagar thanks for reporting this! It looks like @etep responded with some debugging steps on https://github.com/pixie-io/pixie/issues/592, so let's continue the conversation there.

htroisi avatar Sep 15 '22 04:09 htroisi

@htroisi I would like to ask a question, what technology is pixie using to capture Java flame maps? async-profiler? or JFR?

asasas234 avatar Mar 29 '23 04:03 asasas234

I have no more questions, and by looking at https://blog.px.dev/cpu-profiling-java/#title and https://blog.px.dev/cpu-profiling/ I have roughly understood how the implementation works.

asasas234 avatar Mar 29 '23 12:03 asasas234