Exception - Java heap space

M

Magnus Warker

Hi,

below is an exception found in my tomcat log. It's a GWT app.

What is going on there?

Magnus

-----
Sep 14, 2012 10:58:14 PM org.apache.catalina.core.ApplicationContext log
SEVERE: Exception while dispatching incoming RPC call
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2760)
at java.util.Arrays.copyOf(Arrays.java:2734)
at java.util.ArrayList.ensureCapacity(ArrayList.java:167)
at java.util.ArrayList.add(ArrayList.java:351)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.append(ServerSerializationStreamWriter.java:583)
at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeInt(AbstractSerializationStreamWriter.java:100)
at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:116)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter$ValueWriter$8.write(ServerSerializationStreamWriter.java:153)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue(ServerSerializationStreamWriter.java:539)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeClass(ServerSerializationStreamWriter.java:709)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeImpl(ServerSerializationStreamWriter.java:748)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:621)
at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:126)
at
com.google.gwt.user.client.rpc.core.java.util.Collection_CustomFieldSerializerBase.serialize(Collection_CustomFieldSerializerBase.java:44)
at
com.google.gwt.user.client.rpc.core.java.util.ArrayList_CustomFieldSerializer.serialize(ArrayList_CustomFieldSerializer.java:39)
at
com.google.gwt.user.client.rpc.core.java.util.ArrayList_CustomFieldSerializer.serializeInstance(ArrayList_CustomFieldSerializer.java:51)
at
com.google.gwt.user.client.rpc.core.java.util.ArrayList_CustomFieldSerializer.serializeInstance(ArrayList_CustomFieldSerializer.java:28)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeImpl(ServerSerializationStreamWriter.java:740)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:621)
at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:126)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter$ValueWriter$8.write(ServerSerializationStreamWriter.java:153)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue(ServerSerializationStreamWriter.java:539)
at com.google.gwt.user.server.rpc.RPC.encodeResponse(RPC.java:616)
at
com.google.gwt.user.server.rpc.RPC.encodeResponseForSuccess(RPC.java:474)
at
com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:571)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
at
com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 
R

Robert Klemme

Hi,

below is an exception found in my tomcat log. It's a GWT app.

What is going on there?

Magnus

-----
Sep 14, 2012 10:58:14 PM org.apache.catalina.core.ApplicationContext log
SEVERE: Exception while dispatching incoming RPC call
java.lang.OutOfMemoryError: Java heap space
...

Well, what do you think does OutOfMemoryError mean? What does the
class's JavaDoc say? Beyond that since we have almost zero information
and there's nobody with a crystal ball around (AFAIK) we'll have a hard
time answering the question more thoroughly.

Cheers

robert
 
L

Lew

Robert said:
Well, what do you think does OutOfMemoryError mean? What does the

Ooh! Ooh! I know! It means the JVM ran out of heap memory for new allocations.
class's JavaDoc say? Beyond that since we have almost zero information
and there's nobody with a crystal ball around (AFAIK) we'll have a hard
time answering the question more thoroughly.

One common cause is failure to let go of object references.
 
D

Daniel Pitts

Ooh! Ooh! I know! It means the JVM ran out of heap memory for new allocations.


One common cause is failure to let go of object references.
Another (which seems as likely in this case) appending too much data to
an automatically resizing buffer, such as a StringBuilder, or ArrayList.
Given the stack trace, it appears the be an ArrayList.

It could be the OP needs to increase the memory allowed. It also could
be that too much data is being submitted (looks like a RPC<->gwt bridge,
maybe they are sending the whole world).
 
R

Roedy Green

OutOfMemoryError

I presume you have no problem understanding what "out of memory"
means. You want to know WHY this happened.

1. perhaps your problem is too big for the amount of RAM. Change the
memory assignments on the java.exe command line. See
http://mindprod.com/jgloss/javaexe.html

2. Perhaps you are packratting, holding on to objects you don't really
need. See http://mindprod.com/jgloss/packratting.html

3. You need a tool to figure out what is happening, letting you
monitor how many objects there are of various types. see
http://mindprod.com/jgloss/profiler.html
 
L

Lew

Roedy said:
Magnus Warker wrote, quoted or indirectly quoted someone who said :

I presume you have no problem understanding what "out of memory"
means. You want to know WHY this happened.

1. perhaps your problem is too big for the amount of RAM. Change the
memory assignments on the java.exe command line. See
http://mindprod.com/jgloss/javaexe.html

2. Perhaps you are packratting, holding on to objects you don't really
need. See http://mindprod.com/jgloss/packratting.html

3. You need a tool to figure out what is happening, letting you
monitor how many objects there are of various types. see
http://mindprod.com/jgloss/profiler.html

Useful standard tools for memory woes:

http://docs.oracle.com/javase/7/docs/technotes/tools/index.html#monitor
http://docs.oracle.com/javase/7/docs/technotes/tools/share/jstat.html
http://docs.oracle.com/javase/7/docs/technotes/tools/share/jhat.html
 
K

Kevin McMurtrie

It appears that the response was very large and GWT code doesn't support
streaming.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top