-XX:NativeMemoryTracking=detail
jps
ps -p <PID> -o pcpu,rss,size,vsize
| import java.io.IOException; | |
| import java.net.URLClassLoader; | |
| import java.nio.file.Files; | |
| import java.nio.file.Paths; | |
| import java.nio.file.Path; | |
| /** | |
| * Example demonstrating a ClassLoader leak. | |
| * | |
| * <p>To see it in action, copy this file to a temp directory somewhere, |
| |----------------------------------------------------------------------------------------|--------------------| | |
| | Object Header (64 bits) | State | | |
| |-------------------------------------------------------|--------------------------------|--------------------| | |
| | Mark Word (32 bits) | Klass Word (32 bits) | | | |
| |-------------------------------------------------------|--------------------------------|--------------------| | |
| | identity_hashcode:25 | age:4 | biased_lock:1 | lock:2 | OOP to metadata object | Normal | | |
| |-------------------------------------------------------|--------------------------------|--------------------| | |
| | thread:23 | epoch:2 | age:4 | biased_lock:1 | lock:2 | OOP to metadata object | Biased | | |
| |-------------------------------------------------------|--------------------------------|--------------------| | |
| | |
Magic words:
psql -U postgresSome interesting flags (to see all, use -h or --help depending on your psql version):
-E: will describe the underlaying queries of the \ commands (cool for learning!)-l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)