@Jeff
As you suggested me, I tried the followig without success (same OOME
problem):

public class ResultNode<T extends IResultNode> implements IResultNode
and
public interface IResultNode extends Result

Again this is syntaxically correct and compiles sucessfully with
javac, BUT gives again the OOME problem with the GWT compiler.

So apprently the problem is NOT due to the self-referenced generics
ResulNode<T extends ResultNode<?>>

@Miguel
As youl suggests in your link, is the problem the serialization of an
array of type T : T[] next; ?

As a workarround, I'll try to replace this array T[] by an
ArrayList<T> which serializes without know issue.
Yves


On 11 nov, 19:30, Miguel Méndez <mmen...@google.com> wrote:
> Thanks.  I was able to reproduce the problem and filed issue
> 5582<http://code.google.com/p/google-web-toolkit/issues/detail?id=5582>
> .
>
> @zhuyi: can you take a look at this bug?
>
> On Thu, Nov 11, 2010 at 11:58 AM, yves <yves.ko...@gmail.com> wrote:
> > Miguel,
>
> > Here is the ResultNode class
>
> > public class ResultNode<T extends ResultNode<?>> implements Result {
>
> >        private static final long serialVersionUID = -3560238969723137110L;
>
> >        public int dataType;
> >        public int id1;
> >        public int id2;
> >        public int id3;
> >        public int id4;
> >        public int numChildren;
> >        public String data;
> >        public T[] next;
>
> >        public ResultNode() {}
> > }
>
> > and its parent, which is an empty placeholder for Serializable:
>
> > public interface Result extends Serializable {
>
> > }
>
> > This class implements a node in a tree.
> > The goal of the generics is to define the children nodes type (the
> > next[] member).
> > Actually ResultNode is not used by itself, only subtypes are
> > instanciated. Subtypes of ResultNode define only additional int,
> > boolean or float members. Nothing else.
>
> > Even if the goal here is not to justify why I am doing this, this
> > usage of the genrics allows me to remove from the code many unsafe
> > type cast. Now with the generics I am sure of the member type
> > (next[]). Isn't this the goal of generics ? :-)
>
> > Yves
>
> > On 11 nov, 17:34, Miguel Méndez <mmen...@google.com> wrote:
> > > @yves: What does the ResultNode class look like?  It is class
> > ResultNode<T
> > > extends ResultNode<?>> but what about its supertype and fields?
>
> > > On Thu, Nov 11, 2010 at 10:50 AM, yves <yves.ko...@gmail.com> wrote:
> > > > Chris,
>
> > > > JConsole does not succeed to connect to the java compilation : I get
> > > > an out of memory error in sun.rmi.transport.tcp.TCPTransport
> > > > $AcceptLoop.executeAcceptLoop while trying to start a new thread.
> > > > => Result: no data in jconsole
>
> > > > The compiler is the one shipped with GWT 2.1.0RC1
>
> > > > I'll send you the output of -verbose:gc
> > > > Yves
>
> > > > On 10 nov, 23:26, Chris Conroy <con...@google.com> wrote:
> > > > > Yves,
>
> > > > > You say this error did not occur before your most recent change. It
> > > > > would be useful to get an idea for the memory usage before this
> > > > > change: it could be that your app is just very large and you were
> > > > > already on the edge of an OOME, your change really necessitates more
> > > > > memory, or this is a pathological case.
>
> > > > > Here are a few things to try for gathering more useful information:
>
> > > > > -Try attaching jconsole to the compile in the before and after
> > > > > scenario and see how the memory usage compares between both.
>
> > > > > -add -XX:-HeapDumpOnOutOfMemoryError to the JVM args for your failing
> > > > > compile. There may be some interesting data in the resulting dump. If
> > > > > you can share the heap dump with us (you can send me a link off list
> > > > > if you like), then I can take a look.
>
> > > > > -Of course, make sure you are using the latest version of the GWT
> > > > > compiler. The 2.1 compiler contains some changes that will reduce the
> > > > > memory footprint of your compile.
>
> > > > > On Wed, Nov 10, 2010 at 1:20 PM, Scott Blum <sco...@google.com>
> > wrote:
> > > > > > Hmmm.... what happens if you turn down the log level, say to
> > "WARN"?
> > > > > > Are you invoking from the command line, or are you using the Google
> > > > Plugin
> > > > > > for Eclipse?
>
> > > > > > On Wed, Nov 10, 2010 at 4:16 PM, yves <yves.ko...@gmail.com>
> > wrote:
>
> > > > > >> Scott,
> > > > > >> Thx for the tip. Anyway I can't allocate more than -Xmx1590M and I
> > get
> > > > > >> exactly the same error.
> > > > > >> Yves
>
> > > > > >> On 9 nov, 07:47, Scott Blum <sco...@google.com> wrote:
> > > > > >> > Hmm.... can you increase your virtual memory?
>
> > > > > >> > On Mon, Nov 8, 2010 at 5:13 PM, yves <yves.ko...@gmail.com>
> > wrote:
> > > > > >> > > I can't, I only have 2GB RAM, I get this error as from
> > -Xmx1024M
> > > > > >> > >     [java] Error occurred during initialization of VM
> > > > > >> > >     [java] Could not reserve enough space for object heap
> > > > > >> > >     [java] Could not create the Java virtual machine.
>
> > > > > >> > > and the log level is INFO
> > > > > >> > > Yves
>
> > > > > >> > > On 8 nov, 22:53, Scott Blum <sco...@google.com> wrote:
> > > > > >> > > > What if you turn the heap up to -Xmx2048M?
>
> > > > > >> > > > What log level are you using?
>
> > > > > >> > > > On Mon, Nov 8, 2010 at 4:44 PM, yves <yves.ko...@gmail.com>
> > > > wrote:
> > > > > >> > > > > Hi,
>
> > > > > >> > > > > I had a class named "ResultNode" and the project compiled
> > > > fine.
> > > > > >> > > > > In order to improve the code, I changed this class by
> > adding
> > > > > >> > > > > generic
> > > > > >> > > > > stuff like that : ResultNode<T extends ResultNode<?>>.
> > > > > >> > > > > Of course I adapted the entire project where needed to
> > take
> > > > > >> > > > > advantage
> > > > > >> > > > > of this change.
>
> > > > > >> > > > > Now I get an "Internal compiler error"
>
> > > > > >> > > > > This is produced with java memory settings "-Xmx768M" and
> > > > > >> > > > > "-Xss32M" .
> > > > > >> > > > > (usually the settings are -Xmx128M and default value for
> > -Xss
> > > > and
> > > > > >> > > > > I
> > > > > >> > > > > never had such problem).
>
> > > > > >> > > > > BTW : a "javac" compilation on the project is succesfull,
> > so
> > > > it is
> > > > > >> > > > > not
> > > > > >> > > > > a java error.
>
> > > > > >> > > > > Any suggestion ? If more information is needed do not
> > hesitate
> > > > to
> > > > > >> > > > > ask.
> > > > > >> > > > > Thanks in advance
> > > > > >> > > > > Yves
>
> > > > > >> > > > >     [java] Compiling module
> > com.mycompany.myproject.MyProject
> > > > > >> > > > >     [java]    [ERROR] Errors in
> > > > > >> > > > > 'file:/C:/java/workspace/MyProject/
>
> > > > src/com/mycompany/myproject/client/model/AppActivityMapper.java'
> > > > > >> > > > >     [java]       [ERROR]  Internal compiler error
> > > > > >> > > > >     [java] java.lang.OutOfMemoryError: Java heap space
> > > > > >> > > > >     [java]     at
> > java.util.Arrays.copyOf(Arrays.java:2882)
> > > > > >> > > > >     [java]     at
>
> > java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:
> > > > > >> > > > > 100)
> > > > > >> > > > >     [java]     at
>
> > > > java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:390)
> > > > > >> > > > >     [java]     at
> > > > > >> > > java.lang.StringBuilder.append(StringBuilder.java:119)
> > > > > >> > > > >     [java]     at
>
> > com.google.gwt.dev.util.log.PrintWriterTreeLogger.doBranch(PrintWriterTreeLogger.java:
> > > > > >> > > > > 59)
> > > > > >> > > > >     [java]     at
>
> > com.google.gwt.dev.util.log.AbstractTreeLogger.branch(AbstractTreeLogger.java:
> > > > > >> > > > > 126)
> > > > > >> > > > >     [java]     at
>
> > com.google.gwt.core.ext.TreeLogger.branch(TreeLogger.java:222)
> > > > > >> > > > >     [java]     at
>
> > com.google.gwt.user.rebind.rpc.SerializableTypeOracleBuilder.computeTypeInstantiability(SerializableTypeOracleBuilder.java:
> > > > > >> > > > > 939)
> > > > > >> > > > >     [java]     at
>
> > com.google.gwt.user.rebind.rpc.SerializableTypeOracleBuilder.checkTypeArgument(SerializableTypeOracleBuilder.java:
> > > > > >> > > > > 1412)
> > > > > >> > > > >     [java]     at
>
> > com.google.gwt.user.rebind.rpc.SerializableTypeOracleBuilder.checkSubtype(SerializableTypeOracleBuilder.java:
> > > > > >> > > > > 1219)
> > > > > >> > > > >     [java]     at
>
> > com.google.gwt.user.rebind.rpc.SerializableTypeOracleBuilder.checkSubtypes(SerializableTypeOracleBuilder.java:
> > > > > >> > > > > 1309)
> > > > > >> > > > >     [java]     at
>
> > com.google.gwt.user.rebind.rpc.SerializableTypeOracleBuilder.computeTypeInstantiability(SerializableTypeOracleBuilder.java:
> > > > > >> > > > > 1011)
> > > > > >> > > > >     [java]     at
>
> > com.google.gwt.user.rebind.rpc.SerializableTypeOracleBuilder.checkArrayInstantiable(SerializableTypeOracleBuilder.java:
> > > > > >> > > > > 1107)
> > > > > >> > > > >     [java]     at
>
> > com.google.gwt.user.rebind.rpc.SerializableTypeOracleBuilder.computeTypeInstantiability(SerializableTypeOracleBuilder.java:
> > > > > >> > > > > 977)
> > > > > >> > > > >     [java]     at
>
> > com.google.gwt.user.rebind.rpc.SerializableTypeOracleBuilder.checkTypeArgument(SerializableTypeOracleBuilder.java:
> > > > > >> > > > > 1412)
> > > > > >> > > > >     [java]     at
>
> > com.google.gwt.user.rebind.rpc.SerializableTypeOracleBuilder.checkSubtype(SerializableTypeOracleBuilder.java:
> > > > > >> > > > > 1219)
> > > > > >> > > > >     [java]     at
>
> > com.google.gwt.user.rebind.rpc.SerializableTypeOracleBuilder.checkSubtypes(SerializableTypeOracleBuilder.java:
> > > > > >> > > > > 1309)
> > > > > >> > > > >     [java]     at
>
> > com.google.gwt.user.rebind.rpc.SerializableTypeOracleBuilder.computeTypeInstantiability(SerializableTypeOracleBuilder.java:
> > > > > >> > > > > 1011)
> > > > > >> > > > >     [java]     at
>
> > com.google.gwt.user.rebind.rpc.SerializableTypeOracleBuilder.checkArrayInstantiable(SerializableTypeOracleBuilder.java:
> > > > > >> > > > > 1107)
> > > > > >> > > > >     [java]     at
>
> > com.google.gwt.user.rebind.rpc.SerializableTypeOracleBuilder.computeTypeInstantiability(SerializableTypeOracleBuilder.java:
> > > > > >> > > > > 977)
> > > > > >> > > > >     [java]     at
>
> > com.google.gwt.user.rebind.rpc.SerializableTypeOracleBuilder.checkTypeArgument(SerializableTypeOracleBuilder.java:
> > > > > >> > > > > 1412)
> > > > > >> > > > >     [java]     at
>
> > com.google.gwt.user.rebind.rpc.SerializableTypeOracleBuilder.checkSubtype(SerializableTypeOracleBuilder.java:
> > > > > >> > > > > 1219)
> > > > > >> > > > >     [java]     at
>
> ...
>
> plus de détails »

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to