JPA SequenceGenerator with allocationSize 1 performance tuning

I had a blog last year about fixing the sequence number going wild by setting the allocationSize to 1. Overall it solves the inconsistency problem if you are using a sequence with ‘INCREMENT BY’ value 1 in database. Issue One problem comes up today is I am facing some performance issue with the above setting when I…

5 Coding Hacks to Reduce GC Overhead

Some background The GC is built to handle large amounts of allocations of short lived objects (think of something like rendering a web page, where most of the objects allocated become obsolete once the page is served). The GC does this using what’s called a “young generation” – a heap segment where new objects are…

jpa performance over jdbc for large table

I have a table with about 80 million records. While I was doing a simple query using JPA with 2-3 predicates. It takes about 120s to get the result, comparing the 1s using JDBC. Notice, i am using exactly the same query that the jpa generates. This is somehow frustrating. To be honest, I have…