These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: OutofMemory error from persistent set
PostPosted: Wed Jul 08, 2009 7:50 am 
Newbie

Joined: Wed Jul 08, 2009 7:36 am
Posts: 1
I am getting outofmemory error in my java application. On analyzing heapdump of the application , I find that presistent set object of hibernate is consuming nearly 1 GB heapspace.

Following are the mapping files I am using. EMSDataRecord class holds above mentioned set containing objects of EventRecords( Mapping file for this is pasted below EMSDataRecord). Primary key for EMSDataRecord is RECORD_ID. There is one to many relation in EMSDataRecord and EventRecord. I checked in the database. For one entry of EMSDataRecord , there are not more than 2 entries of EventRecords. So there is no reason why the set should be so huge.

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >

<hibernate-mapping>

<class
name="EMSDataRecord"
table="EM1_RECORD"
dynamic-update="true"
>

<id
name="RecordId"
type="java.lang.Long"
column="RECORD_ID"
>
<generator class="assigned" />
</id>

<!-- Please do not change the order of the fields CR005-->
<property
name="StreamName"
type="java.lang.String"
column="STREAM_NAME"
update="false"
/>

<property
name="OriginatingSystem"
type="java.lang.String"
column="ORIGINATING_SYSTEM"
update="false"
/>

<property
name="DestinationSystem"
type="java.lang.String"
column="DESTINATION_SYSTEM"
update="false"
/>

<property
name="LayoutName"
type="java.lang.String"
column="LAYOUT_NAME"
update="false"
/>

<property
name="ErrorCode"
type="java.lang.String"
column="ERROR_CODE"
update="false"
/>

<property
name="ErrorDesc"
type="java.lang.String"
column="ERROR_DESC"
update="false"
/>

<property
name="ErrorTimestamp"
type="java.util.Date"
column="ERROR_TIMESTAMP"
update="false"
/>

<property
name="EventTimestamp"
type="java.util.Date"
column="EVENT_TIMESTAMP"
update="false"
/>

<property
name="ResolutionStatus"
type="java.lang.Integer"
column="RESOLUTION_STATUS"
/>

<property
name="ResolutionReason"
type="java.lang.Integer"
column="RESOLUTION_REASON"
/>

<property
name="RecordStatus"
type="java.lang.Integer"
column="RECORD_STATUS"
/>

<property
name="LockStatus"
type="java.lang.Integer"
column="LOCK_STATUS"
/>

<property
name="RejectionRemark"
type="java.lang.String"
column="REJECTION_REMARK"
/>

<property
name="AssignmentRuleId"
column="ASSIGNMENT_RULE_ID"
type="java.lang.Long"
/>

<property
name="CorrectionRuleId"
column="CORRECTION_RULE_ID"
type="java.lang.Long"
/>

<property
name="GroupId"
type="java.lang.Long"
column="GROUP_ID"
/>

<property
name="UserId"
type="java.lang.Long"
column="USER_ID"
/>

<property
name="TeamId"
type="java.lang.Long"
column="TEAM_ID"
/>

<property
name="RecordType"
type="java.lang.Integer"
column="RECORD_TYPE"
/>
<!-- Performance Improvement - Save Without BLOB Change - Added additional attribute to make the attribute read only-->
<property
name="FieldsMap"
type="binary"
column="FIELD_MAP"
update="false"
/>

<property
name="LastUpdTimeStamp"
type="java.util.Date"
column="LAST_UPD_TIMESTAMP"
insert="false"
/>

<set name="EventRecords" lazy="false" cascade="none" inverse = "true" where = "event_type=504">
<key>
<column name="RECORD_ID" />
</key>

<one-to-many class="EventRecord"/>
</set>
</class>
</hibernate-mapping>

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >

<hibernate-mapping>

<class
name="EventRecord"
table="EM1_EVENT"
>
<id
name="EventId"
type="java.lang.Long"
column="EVENT_ID"
unsaved-value="any"
>
<generator class="sequence">
<param name="sequence">SEQ_EVENT_ID</param>
</generator>
</id>

<property
name="RecordId"
type="java.lang.Long"
column="RECORD_ID"
update="false"
/>

<property
name="EventType"
type="java.lang.Integer"
column="EVENT_TYPE"
update="false"
/>

<property
name="ChangedField"
type="java.lang.String"
column="CHANGED_FIELD"
update="false"
/>

<property
name="OldValue"
type="java.lang.String"
column="OLD_VALUE"
update="false"
/>

<property
name="NewValue"
type="java.lang.String"
column="NEW_VALUE"
update="false"
/>

<property
name="ChangeTimestamp"
type="java.util.Date"
column="CHANGE_TIMESTAMP"
update="false"
insert="false"
/>

<property
name="UserId"
type="java.lang.Long"
column="USER_ID"
update="false"
/>

<property
name="ChangeReason"
type="java.lang.Integer"
column="CHANGE_REASON"
update="false"
/>

</class>
</hibernate-mapping>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.