Hi All,We have a java application which does deal with lots of insert,update and select statement.We are using bonecp. So we took some sample heap and analyse it with MAT and its pointing to jdbc leaking. Thus we went into the codes and ensure that all resultset,statement and connection are closed accordingly. Below is the sample of the donimator tree which is pointing to lots of java.util.HashMap. What could help to exactly the identify the correct problem?
Class Name | Shallow Heap | Retained Heap | Percentage
--------------------------------------------------------------------------------------------------------------------------------
| | |
com.mysql.jdbc.JDBC4Connection @ 0xf016d728 | 1,120 | 1,467,296 | 6.22%
|- java.util.HashMap @ 0xf0184890 | 48 | 1,308,152 | 5.54%
| '- java.util.HashMap$Entry[2048] @ 0xf25685e0 | 8,208 | 1,308,104 | 5.54%
| |- java.util.HashMap$Entry @ 0xf1290570 | 32 | 6,624 | 0.03%
| |- java.util.HashMap$Entry @ 0xf05d1098 | 32 | 4,968 | 0.02%
| |- java.util.HashMap$Entry @ 0xf05f2038 | 32 | 4,968 | 0.02%
| |- java.util.HashMap$Entry @ 0xf05f7ef8 | 32 | 4,968 | 0.02%
| |- java.util.HashMap$Entry @ 0xf0622e40 | 32 | 4,968 | 0.02%
| |- java.util.HashMap$Entry @ 0xf06328d8 | 32 | 4,968 | 0.02%
| |- java.util.HashMap$Entry @ 0xf0646338 | 32 | 4,968 | 0.02%
| |- java.util.HashMap$Entry @ 0xf0893f98 | 32 | 4,968 | 0.02%
| |- java.util.HashMap$Entry @ 0xf10d2d78 | 32 | 4,968 | 0.02%
| |- java.util.HashMap$Entry @ 0xf11d9288 | 32 | 4,968 | 0.02%
| |- java.util.HashMap$Entry @ 0xf1248590 | 32 | 4,968 | 0.02%
| |- java.util.HashMap$Entry @ 0xf1253880 | 32 | 4,968 | 0.02%
| |- java.util.HashMap$Entry @ 0xf1380098 | 32 | 4,968 | 0.02%
| |- java.util.HashMap$Entry @ 0xf1564910 | 32 | 4,968 | 0.02%
| |- java.util.HashMap$Entry @ 0xf17ab140 | 32 | 4,968 | 0.02%
| |- java.util.HashMap$Entry @ 0xf17b9150 | 32 | 4,968 | 0.02%
| |- java.util.HashMap$Entry @ 0xf19624f0 | 32 | 4,968 | 0.02%
| |- java.util.HashMap$Entry @ 0xf1b4ecf0 | 32 | 4,968 | 0.02%
| |- java.util.HashMap$Entry @ 0xf01848c0 | 32 | 3,312 | 0.01%
| |- java.util.HashMap$Entry @ 0xf04607f0 | 32 | 3,312 | 0.01%
| |- java.util.HashMap$Entry @ 0xf0488f28 | 32 | 3,312 | 0.01%
| |- java.util.HashMap$Entry @ 0xf0489bf0 | 32 | 3,312 | 0.01%
| |- java.util.HashMap$Entry @ 0xf05d03a8 | 32 | 3,312 | 0.01%
| |- java.util.HashMap$Entry @ 0xf05d2110 | 32 | 3,312 | 0.01%
| |- java.util.HashMap$Entry @ 0xf05d34a0 | 32 | 3,312 | 0.01%
| '- Total: 25 of 644 entries; 619 more | | |
|- com.mysql.jdbc.MysqlIO @ 0xf0183640 | 224 | 129,384 | 0.55%
|- java.util.Properties @ 0xf01a5708 | 48 | 8,936 | 0.04%
|- java.util.HashMap @ 0xf01c1a60 | 48 | 3,472 | 0.01%
|- java.lang.String[256] @ 0xf0183230 | 1,040 | 1,040 | 0.00%
|- com.mysql.jdbc.ConnectionPropertiesImpl$StringConnectionProperty @ 0xf017c928 | 64 | 544 | 0.00%
|- java.util.GregorianCalendar @ 0xf01c29b0 | 112 | 504 | 0.00%
|- com.mysql.jdbc.ConnectionPropertiesImpl$StringConnectionProperty @ 0xf016eda0 | 64 | 456 | 0.00%
|- java.util.HashMap @ 0xf017ceb0 | 48 | 448 | 0.00%
|- java.util.GregorianCalendar @ 0xf01c27f0 | 112 | 448 | 0.00%
|- java.lang.Throwable @ 0xf01a55e8 | 32 | 288 | 0.00%
|- com.mysql.jdbc.ConnectionPropertiesImpl$MemorySizeConnectionProperty @ 0xf016de08| 80 | 176 | 0.00%
|- java.util.HashMap @ 0xf017d070 | 48 | 128 | 0.00%
|- com.mysql.jdbc.ConnectionPropertiesImpl$IntegerConnectionProperty @ 0xf017ce48 | 72 | 104 | 0.00%
|- com.mysql.jdbc.ConnectionPropertiesImpl$MemorySizeConnectionProperty @ 0xf016e998| 80 | 96 | 0.00%
|- com.mysql.jdbc.ConnectionPropertiesImpl$MemorySizeConnectionProperty @ 0xf016ed40| 80 | 96 | 0.00%
|- com.mysql.jdbc.ConnectionPropertiesImpl$LongConnectionProperty @ 0xf017bca8 | 72 | 96 | 0.00%
|- com.mysql.jdbc.ConnectionPropertiesImpl$IntegerConnectionProperty @ 0xf016e078 | 72 | 88 | 0.00%
|- com.mysql.jdbc.ConnectionPropertiesImpl$IntegerConnectionProperty @ 0xf016e310 | 72 | 88 | 0.00%
|- com.mysql.jdbc.ConnectionPropertiesImpl$IntegerConnectionProperty @ 0xf016e3e8 | 72 | 88 | 0.00%
|- com.mysql.jdbc.ConnectionPropertiesImpl$IntegerConnectionProperty @ 0xf016e8c0 | 72 | 88 | 0.00%
|- com.mysql.jdbc.ConnectionPropertiesImpl$IntegerConnectionProperty @ 0xf016ea38 | 72 | 88 | 0.00%
|- com.mysql.jdbc.ConnectionPropertiesImpl$IntegerConnectionProperty @ 0xf016ea90 | 72 | 88 | 0.00%
|- com.mysql.jdbc.ConnectionPropertiesImpl$IntegerConnectionProperty @ 0xf016eca8 | 72 | 88 | 0.00%
|- com.mysql.jdbc.ConnectionPropertiesImpl$IntegerConnectionProperty @ 0xf016f028 | 72 | 88 | 0.00%
'- Total: 25 of 196 entries; 171 more | | |
class java.lang.ref.Finalizer @ 0xf00011b0 System Class | 16 | 1,366,128 | 5.79%
com.mysql.jdbc.JDBC4Connection @ 0xf015fcf0 | 1,120 | 1,205,632 | 5.11%
com.mysql.jdbc.JDBC4Connection @ 0xf0201ba0 | 1,120 | 1,166,112 | 4.94%
com.mysql.jdbc.JDBC4Connection @ 0xf0094478 | 1,120 | 1,164,016 | 4.93%
com.mysql.jdbc.JDBC4Connection @ 0xf04ab3f0 | 1,120 | 1,123,208 | 4.76%
com.mysql.jdbc.JDBC4Connection @ 0xf00bea28 | 1,120 | 1,020,328 | 4.32%
com.mysql.jdbc.JDBC4Connection @ 0xf0467bc0 | 1,120 | 1,018,376 | 4.32%
com.mysql.jdbc.JDBC4Connection @ 0xf006ee40 | 1,120 | 1,008,784 | 4.27%
com.mysql.jdbc.JDBC4Connection @ 0xf04ad490 | 1,120 | 986,104 | 4.18%
com.mysql.jdbc.JDBC4Connection @ 0xf0076a90 | 1,120 | 975,592 | 4.13%
com.mysql.jdbc.JDBC4Connection @ 0xf00b7bd0 | 1,120 | 937,088 | 3.97%
com.mysql.jdbc.JDBC4Connection @ 0xf01a27c0 | 1,120 | 890,920 | 3.78%
com.mysql.jdbc.JDBC4Connection @ 0xf021c830 | 1,120 | 828,392 | 3.51%
com.mysql.jdbc.JDBC4Connection @ 0xf0097818 | 1,120 | 826,992 | 3.50%
com.mysql.jdbc.JDBC4Connection @ 0xf01c2d80 | 1,120 | 769,928 | 3.26%
com.mysql.jdbc.JDBC4Connection @ 0xf012b158 | 1,120 | 750,448 | 3.18%
com.mysql.jdbc.JDBC4Connection @ 0xf04693e0 | 1,120 | 735,320 | 3.12%
com.mysql.jdbc.JDBC4Connection @ 0xf1603618 | 1,120 | 728,792 | 3.09%
com.mysql.jdbc.JDBC4Connection @ 0xf147f438 | 1,120 | 712,168 | 3.02%
com.mysql.jdbc.JDBC4Connection @ 0xf15ff7d0 | 1,120 | 473,464 | 2.01%
com.mysql.jdbc.JDBC4Connection @ 0xf148fd70 | 1,120 | 432,384 | 1.83%
Total: 22 of 6,692 entries; 6,670 more | | |
--------------------------------------------------------------------------------------------------------------------------------