Wednesday, January 16, 2019

Java 8 - Functional Interfaces


Java functional interfaces use cases :





Primitive specializations



Method reference receipt:




Reference :  Modern Java In action book

Friday, January 11, 2019

Java performance tuning

Articles

1. Simple tuning : link

2. How to write memory efficient code - Youtube video link

Notes:

* Check the current log level first
This recommendation should be obvious, but unfortunately, you can find lots of code that ignores it. Before you create a debug message, you should always check the current log level first. Otherwise, you might create a String with your log message that will be ignored afterward.

Java throubleshooting

Articles

1. Types of profiles : link , Youtube video

2. How to get high CPU usage in java(thread dump) : link 

3. Heap dump analysis, Youtube video : link

4. Article for OutOfMemmoryError : link

Some useful commands
- jps
- jmap -histo:[live] PID -> for historgram
- jmap dump : filename PID -> heap dump
  example: jmap -dump:live,format=b,file=/tmp/dump.hprof
- XX:HeapDumpOutOfMemoryError and XX:HeapDumpFileLocation $some_path