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

4
  • did you get rid of the error?? Commented Dec 7, 2016 at 6:48
  • @SachinSarawgi not yet.. New error found. see edited Commented Dec 7, 2016 at 10:11
  • Dont down vote . If you are so exper then just leave it @down voter Commented Dec 7, 2016 at 10:12
  • I think their is some error in your coding part. Could you please post full error stack or this is the only error stack its showing?? Commented Dec 7, 2016 at 11:41

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

2 Comments

i have 4 GB ram. can i use -Xmx2048m ?
yes 2GB is sufficient. but you can also go with 1GB

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.