I carried out a rudimentry
test to compare memory utilization by Hibernate (utilizing full resources vs only using connection manager), iBATIS and
JDBC. Here is the order of call (if that matters):
1. Plain JDBC call
2. Hibernate connection manager
3. Hibernate
4. iBATIS
Each flow created a new connection but the memory calculation only inlcluded portion of code that is directly responsible for stored procedure execution / query execution. When I executed the code multiple times (over 10) in the same order (and for same data), the memory utilization was not consistent but porportion was somewhat consistent: JDBC took the least memory, and then hibernate with only connection manager, iBATIS and Hibernate. It was hard to record execution time (even milliseconds scale could not record).
If other goups have gone through similar path it would be nice to discuss. Also, about any sophisticated tools available for the same purpose besides WAS profiling mode.
Here is a typical memory snapshot:
----------------------USING ONLY THE CONNECTION MANAGER-------------
1. Total memory allocated for JVM: 15110 KB
2. BEFORE SP CALL: Total memory used: 10415 KB
3. AFTER SP CALL: Total memory used: 11721 KB
4. Additional memory used: 1306 KB
----------------------USING FULL HIBERNATE RESOURCES-------------
1. Total memory allocated for JVM: 15110 KB
2. BEFORE SP CALL: Total memory used: 12235 KB
3. AFTER SP CALL: Total memory used: 13839 KB
4. Additional memory used: 1604 KB
----------------------USING PLAIN JDBC RESOURCES-------------
1. Total memory allocated for JVM: 15110 KB
2. BEFORE SP CALL: Total memory used: 15087360 B
3. AFTER SP CALL: Total memory used: 15087416 B
4. Additional memory used: 56 B
----------------------USING iBATIS-------------
1. Total memory allocated for JVM: 14355 KB
2. BEFORE SP CALL: Total memory used: 9349 KB
3. AFTER SP CALL: Total memory used: 10389 KB
4. Additional memory used: 1040 KB