Re: [scalatest-users] ScalaTest build fails...

62 views
Skip to first unread message

Imtiaz Ahmed H E

unread,
Feb 1, 2010, 4:51:22 AM2/1/10
to scalate...@googlegroups.com
Hi,
 
Failing the lack of a resolution from anyone on this group to my build problem, I set up an Eclipse Scala Plugin project for ScalaTest and executed a "Build Project".
 
After 9% progress I got a message "Compilation (scalac) crashed, Java heap space".
 
Bill (Venners), can you please help.
 
I did not try using the NetBeans Scala plugin as its not final and, moreover, uses Scala 2.8 which is just now into beta and am not sure how reliable that whole setup is.
 
Bill, may I remind you that I had this thing working correctly both within Netbeans and at the command prompt, when you and I were in direct email contact a few months back.
 
Imtiaz
 
----- Original Message -----
Sent: Tuesday, January 19, 2010 8:15 AM
Subject: Re: [scalatest-users] ScalaTest build fails...

Well...I believe the "export" concept isn't applicable to Windows/DOS.
 
However, I did try out the other way to set the env var, per your Microsoft suport URL...in fact I set a system variable JAVA_OPTS to the required value, which just makes it available to all users...
 
It didn't work...we still have...
 
D:\SVNCheckoutsArtima\ScalaTest>ant test
Buildfile: build.xml
 
init:
 
compile-main:
   [scalac] Compiling 139 source files to D:\SVNCheckoutsArtima\ScalaTest\target
\jar_contents
   [scalac] Error occurred during initialization of VM
   [scalac] Could not create the Java virtual machine.
   [scalac] Could not reserve enough space for object heap
 
BUILD FAILED
D:\SVNCheckoutsArtima\ScalaTest\build.xml:158: Compilation failed because of an
internal compiler error; see the error output for details.
 
Total time: 0 seconds
 
Imtiaz
----- Original Message -----
Sent: Monday, January 18, 2010 11:23 PM
Subject: Re: [scalatest-users] ScalaTest build fails...

2010/1/18 Imtiaz Ahmed H E <in.i...@gmail.com>
Hi !
 
That didin't work either....vide :
 
D:\SVNCheckoutsArtima\ScalaTest>set JAVA_OPTS=-Xmx2048m
 
D:\SVNCheckoutsArtima\ScalaTest>ant test
Buildfile: build.xml
 
init:

<snip>
 
Looks like the variable isn't registered properly.

Maybe you need to set the environment variable such that it is valid outside the scope of the command shell? 


Regards, 
Kjersti



--
You received this message because you are subscribed to the Google
Groups "scalatest-users" group.
To post to this group, send email to scalate...@googlegroups.com
To unsubscribe from this group, send email to
scalatest-use...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/scalatest-users?hl=en
ScalaTest itself, and documentation, is available here:
http://www.artima.com/scalatest

Bill Venners

unread,
Feb 1, 2010, 12:25:11 PM2/1/10
to scalate...@googlegroups.com
Hi Imtiaz,

I think all you need is to increase the memory for the build.
ScalaTest needs a lot of memory to build. If it says you're out of
Java heap space, that's what it's telling you. I don't remember
exactly how to do that on Windows, but it should be in the Java
documentation. I think that you probably just need to set the
appropriate environment variables. The ones I use are:

JAVA_OPTS="-Xmx1280M"
export JAVA_OPTS
ANT_OPTS="-Xmx256m -Dscala.home=$SCALA_HOME"
export ANT_OPTS


If those don't work for you, then you should try increasing the memory
even further. I had to increase the 1280M to get ScalaTest to compile
under 2.8.

Hope that helps.

Bill

--
Bill Venners
Artima, Inc.
http://www.artima.com

Imtiaz Ahmed H E

unread,
Feb 2, 2010, 12:08:31 AM2/2/10
to scalate...@googlegroups.com
Hi Bill,

Correct me If I am wrong here, but, perhaps, I (and others?) are barking up
the wrong tree...

The NetBeans Scala Plugin (when I tried it a month ago with NB 6.7, now I
use 6.8)) and the command prompt build give the errors:

> [scalac] Error occurred during initialization of VM
> [scalac] Could not create the Java virtual machine.
> [scalac] Could not reserve enough space for object heap
BUILD FAILED
> D:\SVNCheckoutsArtima\ScalaTest\build.xml:158: Compilation failed because
> of
> an
> internal compiler error; see the error output for details.

(see mail down below)

This suggests that the JVM could not reserve the *requested* space for the
object heap. Its not that the heap size is insufficient...
In fact I remember sepecifying -Xmx512M ( of course, insufficient for the
scalac ant task compilation for ScalaTest) and I got the same error !
I specified this in the offending line (line no158)

<scalac srcdir="${scalasrc}" destdir="${classes}" target="jvm-1.5"
classpathref="build.class.path" addparams="-Xno-varargs-conversion"
fork="true" jvmargs="${jvmargs}" />

in build.xml.

The Eclipse Scala plugin build, though, says "Compilation (scalac) crashed,
java heap space", and this perhaps does suggest that the heap *is*
insufficient ?

Please do help, I'm keen on getting going on ScalaTest development !

Imtiaz Ahmed H E

unread,
Feb 2, 2010, 1:33:39 AM2/2/10
to scalate...@googlegroups.com
Hi Bill,

Could this be the problem...

I use Scala 2.7.7 and maybe that doesn't support 'fork' in the Ant task task
'scalac' and when a new process is not forked for the compilation the JVM
does not find enough space in the existing process to create the object heap
?

I searched 'scalac ant task' on the scala-lang site and found the message
below from you for example...

I guess I will download the Scala 2.8 distribution and give it a
try...keeping my fingers crossed...!
<quote>

Hi All,

I finally had time to try ScalaTest under 2.7.7.RC1. Seems to work
just fine. Can build and run. And can run scalatest-0.9.5 (which was
built under 2.7.3) on it as well. So green bar from me.

One thing that would be a nice-to-have if there's ever a 2.7.8 is
support for "fork" and "jvmargs" in the scalac ant task. This is in
the 2.8 trunk, but I've been using a 2.7.? patched version to be able
to use fork and jvmargs in the 2.7 branch scalac ant task.

Bill

<end of quote>

Reply all
Reply to author
Forward
0 new messages