0

I am using Netbeans IDE and Tomcat server. When executing hibernate call , i am getting error like this.

java.lang.OutOfMemoryError: Java heap space
    at org.hibernate.type.descriptor.java.ByteArrayTypeDescriptor.wrapBytes(ByteArrayTypeDescriptor.java:145)
    at org.hibernate.type.descriptor.java.ByteArrayTypeDescriptor.wrap(ByteArrayTypeDescriptor.java:124)
    at org.hibernate.type.descriptor.java.ByteArrayTypeDescriptor.wrap(ByteArrayTypeDescriptor.java:42)
    at org.hibernate.type.descriptor.sql.VarbinaryTypeDescriptor$2.doExtract(VarbinaryTypeDescriptor.java:71)
    at org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:64)
    at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:267)
    at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:263)
    at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:253)
    at org.hibernate.type.AbstractStandardBasicType.hydrate(AbstractStandardBasicType.java:338)
    at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2969)

How to overcome this error? Give me a clear indication what should i do. I saw some solutions but those were not clear to me.


after configuring (Netbeans) its Ok. No Hibernate error . But now showing -

 java.lang.OutOfMemoryError: Java heap space
at java.lang.reflect.Array.newInstance(Array.java:75)
at org.hibernate.type.descriptor.java.ArrayMutabilityPlan.deepCopyNotNull(ArrayMutabilityPlan.java:43)
at org.hibernate.type.descriptor.java.MutableMutabilityPlan.deepCopy(MutableMutabilityPlan.java:52)
at org.hibernate.type.AbstractStandardBasicType.deepCopy(AbstractStandardBasicType.java:321)
at org.hibernate.type.AbstractStandardBasicType.deepCopy(AbstractStandardBasicType.java:317)
at org.hibernate.type.TypeHelper.deepCopy(TypeHelper.java:67)

Thanks in advance

Shifat
  • 35
  • 9

1 Answers1

1

You can set it in NetBeans in the project properties -> Run -> VM options

  1. Right click on your project "Properties"
  2. Select "Run" category.
  3. Enter your arguments(-Xmx512m) in the "VM Options" text box.

Example: Putting -Xmx512m in the "VM Options" text box gives 512Mb maximum heap size to your Java program.

here is the full answer heap space

Community
  • 1
  • 1
Doctor Who
  • 747
  • 1
  • 5
  • 28