The role of sleep mode on the heap

I have JProfiling my application for analyzing high CPU usage. CPU utilization is 100% ( on the server ) during user login. So began profiling my application.

Below are the query strings found in heap dumps. Not only these 4 requests, there are hundreds of such requests in the dump.

java.lang.String (0x3262b1) ["/* load com.v4common.shared.beans.transaction.ControlTransaction */ select controltra0_.id as id47_48_, controltra0_.form_transaction_id as form2_47_48_, controltra0_.string_value as string3_47_48_, c"] 129 kB (0 %) java.lang.String (0x310b2f) ["/* load com.v4common.shared.beans.transaction.ReportTransaction */ select reporttran0_.id as id158_45_, reporttran0_.report_id as report2_158_45_, reporttran0_.norm_id as norm3_158_45_, reporttran0_.d"] 124 kB (0 %) java.lang.String (0x312222) ["/* load com.v4common.shared.beans.transaction.ReportItemTransaction */ select reportitem0_.id as id160_41_, reportitem0_.report_structure as report2_160_41_, reportitem0_.grid_row_criteria as grid3_16"] 110 kB (0 %) java.lang.String (0x30c104) ["/* load com.v4common.shared.beans.Reports.EsenderCSReport */ select esendercsr0_.id as id117_36_, esendercsr0_.name as name117_36_, esendercsr0_.report_type as report3_117_36_, esendercsr0_.is_show_pr"] 94,248 bytes (0 %) java.lang.String (0x30d1dc) ["/* load com.v4common.shared.beans.Reports.ReportStructure */ select reportstru0_.id as id120_35_, reportstru0_.name as name120_35_, reportstru0_.xml as xml120_35_, reportstru0_.esender_format as esend"] 90,736 bytes (0 %) 

I just logged in and I don’t touch beans at all, but I can still see them on dumps.

Any ideas why these lines are in a dump?

Or what does this line mean?

+8
java heap java-ee hibernate jprofiler
source share
2 answers

This is normal, these are pre-prepared Hibernate requests prepared at server startup.

Take, for example, the ControlTransaction class. Hibernate already knows that it will probably require queries to select objects by ID, delete them, etc.

Thus, he pre-creates a series of prepared SQL statements to perform these operations. The comments at the beginning of each request indicate why they are generated.

For example, this request was generated to load a ControlTransaction by identifier:

 /* load com.v4common.shared.beans.transaction.ControlTransaction */ select controltra0_.id as id47_48_, controltra0_.form_transaction_id as form2_47_48_, controltra0_.string_value as string3_47_48_, c 

Requests starting with one-to-many or one-to-one comments are used for lazy loading, etc. Named queries in JPQL / HQL are also compiled into an SQL query at server startup, and a comment identifies which named query originated from the SQL query.

Each object will generate several of these queries, depending on the display annotations used.

So it’s actually normal that these requests are present on the heap the first time a user logs on to the system.

+5
source share

Do you have these queries like @NamedQueries (or @NamedQuery ) for any of your objects?

Hibernate can load named requests into the cache when the server boots. They, of course, are parsed at startup to check syntax, etc.

0
source share

All Articles