Results 1 to 2 of 2

Thread: Spring Hibernate java.lang.OutOfMemoryError: GC overhead limit exceeded

  1. #1

    Exclamation Spring Hibernate java.lang.OutOfMemoryError: GC overhead limit exceeded

    Hi there,

    I am facing issue in my web application which uses Spring + Hibernate .

    I am randomly getting error

    java.lang.OutOfMemoryError: GC overhead limit exceeded

    when web application is running in tomcat

    I tried to get Heap dump and did analysis of heap dump using Eclipse MAT

    Here are my findings

    Object org.hibernate.impl.SessionFactoryObjectFactory holds 86% of the memory , this object’s Fashhashmap instance holds more than 100000 Hashmaps.
    Inside the every Hashmap there is an instance of org.hibernate.impl.SessionFactoryImpl ,
    It seems org.hibernate.impl.SessionFactoryImpl is loaded several times and stored inside org.hibernate.impl.SessionFactoryObjectFactory ‘s Fashhashmap

    Can somebody help me in finding root cause for this issue and suggest some solution to fix this.

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,632

    Default

    Judging from that you are either reconstructing sessionfactories yourself somewhere or yuo are have improper transaction management or do openSession in your code instead of getCurrentSession.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •