Search code examples
playframeworkplayframework-2.2yourkit

Yourkit profiler with playframework 2.2.3


I've been asked to look into some performance issues with a Playframework 2.2.3 application. I have previous experience with playframework 1 but I realise 2.x is very different.

Has anyone managed to use Yourkit profiler with play 2? I managed to attach the agent by adding an option to the java command in framework/build script. This only attaches the agent to the sbt launcher and therefore the agent dies once the real application is launched.

Does anyone have a solution for this? Perhaps I need to use 'play dist'

Jon


Solution

  • One way would be to create a dist and run it from there with the parameters, you will get a runnable under target/universal/stage/bin/yourappname that you can pass parameters to with JAVA_OPTS or the -J-... parameter.

    The other way is to provide the same parameter but through your sbt config, which will then be passed to the same script (start just builds and runs), note that since it is the script and not the actual jvm you need the -J prefix to any parameter you want to send to the JVM:

    javaOptions in Production += "-J-something"