use Eclipse Memory Analyzer to read the memory dump file
use -Xmx with small value and let your app crash locally
use -XX:+HeapDumpOnOutOfMemoryError
use XX:StartFlightRecording=duration=200s which generates a JFR file, readable using JDK missing control
use pg_stat_statements extension:
# add to your postgresql.conf
shared_preload_libraries = 'pg_stat_statements'
use closed and opened projections by creating custom DTOs used as returned type in your JPA interfaces:
get bulk of items:
use hypersistence-utils to detect where the hibernate SQL query was executed (don’t forget to set the log level logging.level.io.hypersistence.utils.hybernate.query=DEBUG)