2

# I am using Buildr as my build tool. Part of my build process generates Java source from a WSDL using JAX-WS. I have an ANT build script that does this with the wsimport ant task. Using the AntWrap Ruby module in Buildr I can do the same thing.

My problem is I am getting the OutOfMemoryError PermGen space when trying to generate source for many WSDL's. I got the same problem when running Ant by itself but resolved it by setting the ANT_OPTS environment variable to:

set ANT_OPTS=-Xmx512m -XX:PermSize=64m -XX:MaxPermSize=128m

But when I run my build using Buildr I still get the error even though this environment variable is set. I have even tried setting this variable in my build file but this hasn't helped.

My environment is as follows:

  • windows XP
  • JRuby 1.6.3
  • Buildr 1.4.6
  • AntWrap 0.7.0
Ross
  • 3,008
  • 1
  • 22
  • 27

1 Answers1

4

Did you try setting JAVA_OPTS in the buildfile, I am not sure if buildr/antwrap picks up the ANT_OPS environment variables.

ENV['JAVA_OPTS'] ||= '-Xms1g -Xmx1g'
devboy
  • 242
  • 2
  • 8
  • I also think `JAVA_OPTS` will be the solution. Note that it can also be set as an environment variable (rather than in the build file). And just to be extra clear, the construction in this suggestion (`||=`) will only set it to `'-Xms1g -Xmx1g'` if the environment variable is not already set. – Rhett Sutphin Nov 21 '11 at 15:50
  • thanks for the suggestion. I had tried setting JAVA_OPTS as well as JVM_ARGS but still doesn't help – Ross Nov 21 '11 at 16:08
  • if I set the JAVA_OPTS variable outside of the build file (ie in command prompt) then it works. Thanks guys...........that really helped – Ross Nov 21 '11 at 16:11
  • It would still be interesting to know why ENV['JAVA_OPTS'] ||= '-Xmx512m -XX:PermSize=64m -XX:MaxPermSize=128m' at top of the build file doesn't work. But I am happy I have a work around – Ross Nov 21 '11 at 16:21
  • Maybe try it without the "||=" and just use "="? Maybe you've had an environment variable with lower settings before? – devboy Nov 24 '11 at 20:48