What is “Locked ownable synchronizers” in thread dump?

TL;DR: write locks appear in the “ownable synchronizers” list, read locks don’t. I ended up with the following MVCE to try and understand what’s with “ownable synchronizer”. The idea was to have two threads locking/unlocking read/write reentrant locks and see the effect on different thread dumps at different timings (taken in jVisualVM while the Eclipse … Read more

Java thread dump: Difference between “waiting to lock” and “parking to wait for”?

You will get “waiting to lock” in the thread dump when using intrinsic locks and “parking to wait for” when using locks from java.util.concurrent. Consider the following example: import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; public class LockTest { final Lock lock = new ReentrantLock(true); synchronized void intrinsicLock() { Thread th = new Thread(new Runnable() { public void … Read more

How to get a thread and heap dump of a Java process on Windows that’s not running in a console

You can use jmap to get a dump of any process running, assuming you know the pid. Use Task Manager or Resource Monitor to get the pid. Then jmap -dump:format=b,file=heap.hprof <pid> to get the heap for that process. For systems where bash and pgrep are installed and a single Java process is running, try: jmap … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)