[hibernate-issues] [Hibernate-JIRA] Created: (HHH-4031) Outofmemory error in hibernate persisten set

Shripad (JIRA) noreply at atlassian.com
Wed Jul 8 07:02:12 EDT 2009


Outofmemory error in hibernate persisten set
--------------------------------------------

                 Key: HHH-4031
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4031
             Project: Hibernate Core
          Issue Type: Bug
         Environment: Oracle 10. 
            Reporter: Shripad
            Priority: Blocker


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. Is this a bug in hibernate?

<?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>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list