Widgetset compilation

I’m new with Vaadin and I can’t compile the widgetset following the very easy instructions on:


http://vaadin.com/directory/help/using-vaadin-add-ons

  • create a new default project
  • copy .jar in WEB-INF/lib

The message I get when pressing the Eclipse button “Compile Vaadin Widget” is:

I have tried to modify eclipse.ini:

–launcher.XXMaxPermSize
256m
–launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms256m
-Xmx512m

But yet not working.
If I remove the widget from the WEB-INF/ lib, the application works correctly.

Any suggestion? I suposse is not a Vaadin problem, but I do not know how to conitnue

Could it be that you are running out of virtual memory - the message looks like Eclipse cannot start the new VM at all because of lack of memory, rather than the compilation running out of memory once started.

The widgetset compilation does not run in the Eclipse Java process, and the separate process launched uses the settings “-Xss8M -Xmx512M -XX:MaxPermSize=512M” (at least with recent versions of the Eclipse plugin). These should be plenty for most widgetsets.

Which Vaadin version are you using? Are you using a recent version of the Eclipse plugin?

Eclipse version is the latest:

Eclipse Java EE IDE for Web Developers.
Version: Helios Service Release 1
Build id: 20100917-0705
(Eclipse Galileo SR2, had same problem)

Vaadin plugin is updated too:
Vaadin Eclipse Integration 1.2.1.201003300626 com.vaadin.integration.eclipse.feature.group

Vaadin version
vaadin-6.4.5.jar

GWT plugin is:
Google Plugin for Eclipse 3.6 1.3.3.v201006111317 com.google.gdt.eclipse.suite.e36.feature.feature.group
(from Vaadin doc I cant not be sure if this plugin is need it)

GWT SDK
Google Web Toolkit SDK 2.0.4 2.0.4.v201006301309 com.google.gwt.eclipse.sdkbundle.e36.feature.2.0.4.feature.group

JAVA
Tried with JRE6 and JDK 1.6.0.20. Both with same result

PC is Windows XP with 3GB, and 2GB free.

How can I increase the available memory for VM?

Found this post in a Forum that may relate to this problem. No idea how to solve it.


http://www.eclipsezone.com/eclipse/forums/t104307.html

Is there a way to set the -vm parameter for Vaadin compiler plugin? or maybe it must execute in the jvm.dll of Eclipse?

You could also try to upgrade the Eclipse integration plugin to the experimental branch (update site http://vaadin.com/eclipse/experimental) - but I would not recommend installing the visual editor plugin from that branch right now. There are not many differences between the plugin versions at the moment, but there might be some relevant to the memory usage settings of widgetset compilation.

The GWT plugins are not necessary (the Vaadin plugin would depend on them if they were), although they might make client side debugging slightly easier in some cases. Most Vaadin developers do not need them.

The Java process is run by launching as a separate process the Java executable of the Eclipse project JRE, or the workspace default JRE if none is found for the project (should not happen). It is not run in-process with Eclipse, so the issue you found on EclipseZone should not be relevant.

First of all, thanks for your support.

Experimental plugin version had the same result.

After some googling and testing I isolated the problem to be an issue of java on windows XP.
The machine I use (3GB RAM Win XP SP3) is not able to start a java application with

java.exe -Xmx512M, -XX:MaxPermSize=512M -arg myapp.jar

gives:

Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

But, it do work if the memory requirements are reduced (in my particular case):

java.exe -Xmx512M, -XX:MaxPermSize=440M -arg myapp.jar
or
java.exe -Xmx440M, -XX:MaxPermSize=512M -arg myapp.jar

It seems that this command requires window to reserve 1G of contiguous RAM, and it seems to be that Windows manages memory allocation in an unpredictable way. Any driver, trojan, antivirus, or process can be installed in the middle of your memory space breaking the contiguous ram areas.

It is very frustrating since Windows 32 looks that only will allow to reserve up to 1,5G (less in my case) (http://stackoverflow.com/questions/171205/java-maximum-memory-on-windows-xp) even if your have more memory space.

My point now is that I only have three choices:

  • Move to XP 64bits, not now
  • Use Vaadin without compiling (quite limitating), or not using it at all
  • Modify launch parameters for the Vaadin plug-in and see if it works with less memory.

Is there a place where launch parameters can be modified, some .ini, or parameters field in Eclipse?

I have never had this problem over many years of running Sun JVMs on 32-bit Windows, on many different computers, with memory allocations of 1.5-1.8 GB (biggest ones with the /3GB switch, most without). I wonder what libraries break up the process virtual address space so in your case - if only one, then it has to be exactly in the middle of the address space to prevent a 1 GB allocation.

At the moment, the compilation parameters used by the Eclipse plugin are not user adjustable.

You could try running the widgetset compilation in verbose mode (from Project Properties → Vaadin), and copying the command line segments used to run the compiler to create your own widgetset compilation launch (“Executing compiler with parameters …”) - not difficult, but requires some editing as the format of the parameter list printed in the verbose mode cannot be copied directly.

Alternatively, you could use Ant or other build systems to compile your widgetset.

Thanks for your suggestions.

I finally detected the disturbing source of my problems. In my case was the application “Comodo Firewall”, a popular firewall for WinXP.

As I said at the very beginning it had not much to do with Vaadin, but this was the only plugin that didn’t work in my Eclipse setup, so I started over here.

For anyone that can get in a similar situation I tested the maximum Java program allowed in my Java 1.6.20 and Windows XP SP3 combination with a simple command:

java -Xmx1400m

if the heap is allocable the promt gives you a summary of options, if not you get the infamious error:

Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

After removing that application the maximum changed from 960 to 1447. Not the full memory is available (3GB RAM), but enough to sort out my current need.