Category: Java
-
Group Anagrams
Problem https://leetcode.com/problems/group-anagrams/description/ Solution #1 Solution #2 Better Solution
-
[Code Review] Abstraction Class and Interface
It is very common to face duplicate codes that is likely to be refactored by adding some abstraction. Let’s see what I have been advised from our senior developers regarding with the abstractions. AS-IS Code Example As seen from the above snippet, you can see there is a chance to…
-
How to use Eclipse Memory Analyzer(MAT)
If you add -XX:+HeapDumpOnOutOfMemoryError on the JVM argument, when OOM occurs it’ll leave a heap dump. How to use MAT to analyze heap dump file Reference
-
ThreadDump / HeapDump / GC Log
PLEASE NOTE: Getting thread dump and heap dump are stop the world operations. How to get thread dump How to get heap dump How to generate gc.log How to make a file into .tar.gz file
-

What does Current Thread Busy means?
TL; DR “Current Thread Busy” metric displays how many active threads are in the pool. This shows the value of ThreadPoolExecutor.getActiveCount(). Which reflects the number of the threads that are running their tasks (= the number of the requests that are being currently handled), not necessary has to be RUNNABLE…
-
Ch.07 – Thread Per Message
Process vs Thread Memory Share Process has independent memory space while threads share memory. As threads share memory with each other, communication between them are easier and this results in importance of exclusive control. Context Switch Normally, context switching is easier from threads than processes. Example Different ways of creating…
-
Ch.06 – ReadWrite Lock
The idea behind ReadWriteLock is that allowing the Read operation to be much more flexible which wouldn’t be affected from other Reader thread. When Reader thread tries to acquire lock If a Writer thread is writing, wait. If another Reader thread is reading, do not wait When Writer thread tries…
-
Ch.05 – Producer Consumer Pattern
Data class Works as a “Channel” between the Producer and Consumer. Supports exclusive control Makes the Producer wait if the current size has met the capacity Makes the Consumer wait if the current size is empty Producer , Consumer class Does not have to consider the control of the Data.…
