06 June 2018

JMC + JFR

- jmc comes with JDK 1.7.0_u40+, but it discontinued on JDK9. (and now OpenJDK 11 has it).
- jfr profiler, can save events in a fixed period.
- jmc is open source now: https://github.com/JDKMissionControl/jmc
- right button to save (very intuitive)
- enable: -XX:+UnlockCommercialFeatures -XX:+FlightRecorder  (if you are using JDK8_40+, you can dynamically enable JFR.

You can use the following flags to improve accuracy.
-XX:+UnlockDiagnosticVMOptions -XX:+DebugNonSafepoints

-XX:StartFlightRecording=delay=10s,duration=90s,name=Test,filename=recording.jfr,settings=profile

$ java -XX:+UnlockDiagnosticVMOptions -XX:+DebugNonSafepoints -XX:+UnlockCommercialFeatures -XX:+FlightRecorder -XX:StartFlightRecording=delay=10s,duration=90s,name=Test,filename=recording-test.jfr,settings=profile -jar target/hola-0.0.1.jar

-XX:FlightRecorderOptions=loglevel=info


JMC = Java Mission Control
JFR = Java Flight Recorder

05 June 2018

Alphabest Prize

Thanks for the Prize http://www.gamepuzzles.com/ about Alphabest.


Jax London 2018 Constraint Puzzle

There was a small contest from Jax London 2018.

This puzzle required Constraint Programming, which is solvable using JaCop (among other libraries)

Give it a try (although the contest is over, and I didn't win, but the answer was correct :P ).


High CPU (old fashion)

    A good old way to identify high CPU threads.
    • identify WLS PID : jps -v. (or lsof -i @IP:port)
    • take Thread Dumps: kill -3 <PID>jstack -l <PID>, jcmd <PID> Thread.print
    • top -H -b -p <PID>
    • identify child process from %CPU column
    • convert those PID to Hex (ie: 3141): printf "%x " 3141
    • search those Hex to Thread dump: nid=0xc45

    Blog Archive

    Disclaimer

    The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.