6 Replies Latest reply on May 28, 2010 1:22 AM by ciroppina

    Blazeds error java heap space

    Ramesh Katakam Level 1

      hi

       

      i will get xml tree data from the java method when it returns to flex i am getting below exception

       


      java.lang.OutOfMemoryError: Java heap space
      at java.util.Arrays.copyOf(Arrays.java:2786)
      at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:71)
      at java.io.DataOutputStream.write(DataOutputStream.java:71)
      at flex.messaging.io.amf.Amf3Output.writeAMFString(Amf3Output.java:382)
      at flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:112)
      at flex.messaging.io.amf.Java15Amf3Output.writeObject(Java15Amf3Output.java:26)
      at flex.messaging.io.amf.Amf3Output.writeObjectProperty(Amf3Output.java:243)
      at flex.messaging.io.amf.Amf3Output.writePropertyProxy(Amf3Output.java:566)
      at flex.messaging.io.amf.Amf3Output.writeCustomObject(Amf3Output.java:518)
      at flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:193)
      at flex.messaging.io.amf.Java15Amf3Output.writeObject(Java15Amf3Output.java:26)
      at flex.messaging.messages.AbstractMessage.writeExternal(AbstractMessage.java:352)
      at flex.messaging.messages.AsyncMessage.writeExternal(AsyncMessage.java:140)
      at flex.messaging.messages.AcknowledgeMessage.writeExternal(AcknowledgeMessage.java:92)
      at flex.messaging.messages.AcknowledgeMessageExt.writeExternal(AcknowledgeMessageExt.java:55 )
      at flex.messaging.io.amf.Amf3Output.writePropertyProxy(Amf3Output.java:556)
      at flex.messaging.io.amf.Amf3Output.writeCustomObject(Amf3Output.java:518)
      at flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:193)
      at flex.messaging.io.amf.Java15Amf3Output.writeObject(Java15Amf3Output.java:26)
      at flex.messaging.io.amf.Amf0Output.writeObject(Amf0Output.java:193)
      at flex.messaging.io.amf.Java15Amf0Output.writeObject(Java15Amf0Output.java:41)
      at flex.messaging.io.amf.AmfMessageSerializer.writeObject(AmfMessageSerializer.java:196)
      at flex.messaging.io.amf.AmfMessageSerializer.writeBody(AmfMessageSerializer.java:186)
      at flex.messaging.io.amf.AmfMessageSerializer.writeMessage(AmfMessageSerializer.java:142)
      at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:179)
      at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:274)
      at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:377)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

       

       

      pls help me

        • 1. Re: Blazeds error java heap space
          P.o.l.a.c.o Level 1

          Hi,

           

          Maybe increasing the maximun amount of memory assigned to the JVM could help.

          http://docs.sun.com/source/817-2180-10/pt_chap5.html

           

          HTH.

           

          Pola.

          • 2. Re: Blazeds error java heap space
            levancho Level 3

            this is a purely java issue, you need to diagnose your server configuration, seems like you do not have anough mememory,

             

            BTW how big is your tree I beleive it is causing out of memory problem, maybe it has a recursive refference to one of its parent nodes?

            either way looks like you are building one huge object hierarchy and blazeDS is just running out of memory searializing it.

            • 3. Re: Blazeds error java heap space
              Ramesh Katakam Level 1

              Initially it is loading but when i do few copy/move node opertaio

              ns then it is not working... size is 4053130

              pls help me any other

              • 4. Re: Blazeds error java heap space
                levancho Level 3

                if you describe an issue in litle more detail might help otherwise its not possible to guess what you are doing on ui side,and how and when are you invoking, call to service etc ...

                • 5. Re: Blazeds error java heap space
                  Ramesh Katakam Level 1

                  i have dropdown once a value is selected it will fetch the data in xml fromat and will display in tree sturtcure in flex.

                  pls find attached screen shot for clear picutre

                   

                  we have options like copy node or copy node and its children

                   

                  whevener i drag node from one to other i will call java method to do few operation and gets the modified xml from java which will be displayed with latest changes in the tree. after few opertaions (copy or copy childrens) the request is not at all going to hava method. Is there any problem with timedout out or blazeds.if we copy a nod which has large no of children intially it completes the operation but after if we try to copy a single node then request is not going to java method so pls help metreeerror.JPG

                  • 6. Re: Blazeds error java heap space
                    ciroppina

                    If You are experiencing a message "Error: Java Heap Space" when building Falsh Builder 4 Workpace, or cleaning projects, or generating bin-Relase (expecially for AIR) or launching a Flex App (sdk 3/4) from the IDE

                     

                    here You are the solutions:

                     

                    There are two reasons:

                    a) Flash Builder 4 IDE (Eclipse+Equinox) memory is finshed!
                    b) Run/Debug actions memory in finished!


                    Solutions

                    Solution for case a):
                    - Go to Flash Builder 4 install_dir
                    - edit file: FlashBuilder.ini
                    - increase the following parameters, as follows (or more, depening on system available RAM memory):
                    -Xms256m -> -Xms384m
                    -Xmx384m -> -Xmx512m
                    [if the previous 2 parms are absent, add them to the file, one for line]

                    - save, close file .ini editing
                    - restart Falsh Builder 4

                     

                    Solution for case b):
                    - Go to each of two  /sdks folders, both 3.5 and 4.0, then enter subfolder /bin
                    - edit files: jvm.config
                    - modufy args on the line java.args= as follows (or more):

                         from: -Xmx256m -Dsun.io.useCanonCaches=false
                         to: -Xms384m -Xmx512m -Dsun.io.useCanonCaches=false
                    - save, close editing of jvm.config files
                    - restart Falsh Builder 4

                     

                    Tha's all folks!