I have profiled my J2EE web application using jprofiler. I found there is huge memory leak by looking at vm telemetry graph and recorded object. Using heap walker i conclude that there is a lot of memory leakage because of hibernate criteria, query.list, template.find, over-redid hashCode and equals method and in some of custom request processor. The thing that i am not able to understand is how there could be memory leak.
I checked a lot over google and its understandable that criteria is slower than HQL and obviously than SQL but memory leakage is quite interesting. Is there any chances of memory leak?
Under recorded object screen hashmap objects increased to nearly 100% and memory leakage graph sleeks upward.
I am also showing you my hashcode and equals methol, please have a look:
public boolean equals(Object other) {
if ( !(other instanceof Associate) ) return false;
Associate castOther = (Associate) other;
return new EqualsBuilder()
.append(this.getAssociateId(), castOther.getAssociateId())
.isEquals();
}
public int hashCode() {
return new HashCodeBuilder()
.append(getAssociateId())
.toHashCode();
}
Thanks a lot.