Out of memory error while compiling

222 views
Skip to first unread message

Saurabh Nanda

unread,
May 17, 2006, 6:43:10 AM5/17/06
to google-we...@groups.google.com
Hi,

I'm trying to write a simple calendar app, but after pressing Refresh in the hosted browser I get the following errors:

[ERROR] Errors in 'jar:file:/home/nanda/gwt/gwt-linux-1.0.20/gwt-user.jar!/com/google/gwt/emul/java/lang/Byte.java '
[ERROR]  Internal compiler error
java.lang.OutOfMemoryError: Java heap space
[ERROR] Failure to load module 'in.informationmatters.calendar.Calendar'
java.lang.OutOfMemoryError: Java heap space

Here is the code I'm trying to 'compile':

package in.informationmatters.calendar.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.Button ;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.user.client.ui.Grid ;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Hyperlink;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class Calendar implements EntryPoint {


    private Grid calGrid;
    private Hyperlink nextMonth;
    private Hyperlink prevMonth;
    private int month;
    private int year;   

  /**
   * This is the entry point method.
   */
  public void onModuleLoad()
    {
        calGrid=new Grid(5, 7);
        nextMonth=new Hyperlink("Next >>", "nextMonth");
        prevMonth=new Hyperlink("<< Prev", "prevMonth");
        RootPanel.get("calPrevMonth").add(prevMonth);
        RootPanel.get("calNextMonth").add(nextMonth);
        RootPanel.get("calGrid").add(calGrid);
      }

   
}


Nandz.
--
http://nandz.blogspot.com
http://foodieforlife.blogspot.com

Jani

unread,
May 17, 2006, 6:49:34 AM5/17/06
to Google Web Toolkit
Hello,

Try to use the following runtime parameters to increase the virtual
machine's allocated memory:

-Xms initial java heap size
-Xmx maximum java heap size
-Xmn the size of the heap for the young generation

Cheers,

-Jani

Saurabh Nanda

unread,
May 17, 2006, 6:56:45 AM5/17/06
to Google-We...@googlegroups.com
In the script named 'Calendar-shell' I added -Xmx1024000 like this:

java -Xmx1024000 -cp "$APPDIR/src:$APPDIR/bin:/home/nanda/gwt/gwt- linux-1.0.20/gwt-user.jar:/home/nanda/gwt/gwt-linux-1.0.20/gwt-dev-linux.jar" com.google.gwt.dev.GWTShell -out "$APPDIR/www" "$@" in.informationmatters.calendar.Calendar/Calendar.html;

Now the error has changed to the following:

[TRACE] Loading module 'in.informationmatters.calendar.Calendar'
[TRACE] Loading inherited module 'com.google.gwt.user.User'
[ERROR] Line 8: Unexpected exception while processing element 'inherits'
java.lang.OutOfMemoryError: Java heap space
[ERROR] Failure while parsing XML
[ERROR] Line 4: Unexpected exception while processing element 'inherits'
[ERROR] Failure while parsing XML

[ERROR] Failure to load module ' in.informationmatters.calendar.Calendar'


Miguel Méndez

unread,
May 17, 2006, 8:31:44 AM5/17/06
to Google-We...@googlegroups.com
Hello Saurabh,

I tried this on my Linux system using build gwt-linux-1.0.20 and I was not able to reproduce this problem.  It is possible that my attempt at recreating your project based on the snippet was not accurate enough or there is some environment/configuration issue.  I have attached my project just in case.  What linux variant are you running?  What java version are you running?

It is also interesting to note that in your original email the error reported was: Errors in 'jar:file:/home/nanda/gwt/gwt-linux-1.0.20/gwt-user.jar!/com/google/gwt/emul
/java/lang/Byte.java '.  You may want to do an MD5 check of the download image and compare that to what is listed on the download page.
--
-Miguel
Calendar.tar.gz

digitalsanctum

unread,
May 27, 2006, 11:39:47 AM5/27/06
to Google Web Toolkit
I'm guessing this issue is from the embedded Tomcat. I've had this
issue with and without GWT running on Tomcat on several environments.
This happens to me if I do several refreshes (over the course of hours)
without restarting the shell (Tomcat).

Reply all
Reply to author
Forward
0 new messages