-->
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.  [ 8 posts ] 
Author Message
 Post subject: AntTools: OutOfMemoryError: java heap space
PostPosted: Tue Nov 15, 2005 3:52 am 
Beginner
Beginner

Joined: Mon Jun 06, 2005 4:23 am
Posts: 41
Location: Hagenberg, AUSTRIA
hi!

i get the following exception when using the hibernate ant tools for reverse engineering in eclipse 3.1 (jdk1.5)

Code:
[hibernatetool] SCHWERWIEGEND: Method get threw exception for reference $templates in template pojo/Pojo.vm at  [17,1]

BUILD FAILED
D:\workspace31\DataLogic\build.xml:132: org.hibernate.tool.hbm2x.ExporterException: MethodInvocationException while processing template Pojo. Invocation of method 'get' in  class org.hibernate.tool.hbm2x.TemplateHelper$Templates threw exception class java.lang.OutOfMemoryError : Java heap space


i tried to set the min and max heap size in the eclipse.ini to 512 respectively 768 and i even tried 768 respectively 1024 with the same effect.

what could be the reason for this?

best regards
patrik

Hibernate version:
3.1rc2
hibernate tools that ship with jbosside1.5rc1

Mapping documents:
none

Code between sessionFactory.openSession() and session.close():
none

Full stack trace of any exception that occurs:

Name and version of the database you are using:
computer associates ingres 3.0.2

The generated SQL (show_sql=true):
none

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 15, 2005 4:40 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hmm - how big a table space are you reverse engineering ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 17, 2005 3:18 am 
Beginner
Beginner

Joined: Mon Jun 06, 2005 4:23 am
Posts: 41
Location: Hagenberg, AUSTRIA
i'm trying to reverse engineer 571 tables with up to 58 columns in the "worst" case.

i tried one table with 58 columns... it worked.

any hints for avoiding this heap error?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 17, 2005 4:21 am 
Beginner
Beginner

Joined: Mon Jan 24, 2005 11:56 am
Posts: 24
Hi,

Well, It is good idea to increase the amount of java memeory usage and heap size by using -Xms and -Xmx
-Xms<size> set initial Java heap size
-Xmx<size> set maximum Java heap size

the java start up will look some thing like java -Xms1024 ....

To set the java vm parameter for ant, I think u should run ant manualy like this

Code:
java -Dant.home=c:\ant org.apache.tools.ant.Main [options] [target]
java -Dant.home=c:\ant org.apache.tools.ant.launch.Launcher [options] [target]


And set the -Xms options for java like this:

Code:
java -Xms1024 -Dant.home=c:\ant org.apache.tools.ant.Main [options] [target]
java -Xms1024 -Dant.home=c:\ant org.apache.tools.ant.launch.Launcher [options] [target]


Take a look at
http://ant.apache.org/manual/running.html#sysprops

May be there are other ways for setting java vm properties fo ant.


Regards,
Alireza Fattahi
--------------------------
Please rate if it helped!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 17, 2005 5:01 am 
Beginner
Beginner

Joined: Mon Jun 06, 2005 4:23 am
Posts: 41
Location: Hagenberg, AUSTRIA
thanks afattahi... a call like this solved my problem:

Code:
java -Xms700m -Xmx1024m -cp n:\lib\ant\1.6.2\lib\ant-launcher.jar -Dant.home=n:\lib\ant\1.6.2 org.apache.tools.ant.launch.Launcher hibernate


it seems that the eclipse.ini heap sizes for the virtual machine is just for eclipse itself and ant crashes without using this properties.

maybe you got a hint how set up ant in eclipse to use a bigger heap size?

best regards
patrik


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 17, 2005 12:22 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
its done on one of the tabs in the external tools dialog.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 21, 2005 8:02 am 
Beginner
Beginner

Joined: Mon Jun 06, 2005 4:23 am
Posts: 41
Location: Hagenberg, AUSTRIA
it now works with the ant tools and the eclipse plugin...

thank you!


Top
 Profile  
 
 Post subject: I encounter this problem also, thank you guys!
PostPosted: Tue Jan 03, 2006 12:09 pm 
Newbie

Joined: Wed Dec 07, 2005 11:55 am
Posts: 5
Tips worked.
Thanks.


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

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.