Limited number of objects in Java?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Patrick

    Limited number of objects in Java?

    I'm using Jakarta-POI to create a huge Excel spreadsheet. I get the
    error below when the spreadsheet grows to a large size. It seems to
    have something to do with the number of "cell" objects that I create.
    If I destroy other objects that I don't need any more, then I can
    create more "cell" objects. Unfortunately, I cannot destroy any more
    of my other objects without breaking the program. This does not appear
    to be a problem that is specific to Jakarta-POI. I had the same
    problem with my own custom objects, but in that case I was able to get
    around the problem by only keeping a small number of those objects in
    memory at any given time. I'm debugging this program through JBuilder
    7 using Tomcat 4.0. Perhaps this is a problem with Tomcat and not with
    Java? Any help would be appreciated.

    StandardWrapper Valve[invoker]: Servlet.service () for servlet invoker
    threw exception
    javax.servlet.S ervletException : Invoker service() exception
    javax.servlet.S ervletException : Invoker service() exception
    at org.apache.cata lina.servlets.I nvokerServlet.s erveRequest(Inv okerServlet.jav a:504)
    at org.apache.cata lina.servlets.I nvokerServlet.d oPost(InvokerSe rvlet.java:216)
    at javax.servlet.h ttp.HttpServlet .service(HttpSe rvlet.java:760)
    at javax.servlet.h ttp.HttpServlet .service(HttpSe rvlet.java:853)
    at org.apache.cata lina.core.Appli cationFilterCha in.internalDoFi lter(Applicatio nFilterChain.ja va:247)
    at org.apache.cata lina.core.Appli cationFilterCha in.doFilter(App licationFilterC hain.java:193)
    at org.apache.cata lina.core.Stand ardWrapperValve .invoke(Standar dWrapperValve.j ava:243)
    at org.apache.cata lina.core.Stand ardPipeline.inv okeNext(Standar dPipeline.java: 566)
    at org.apache.cata lina.core.Stand ardPipeline.inv oke(StandardPip eline.java:472)
    at org.apache.cata lina.core.Conta inerBase.invoke (ContainerBase. java:943)
    at org.apache.cata lina.core.Stand ardContextValve .invoke(Standar dContextValve.j ava:190)
    at org.apache.cata lina.core.Stand ardPipeline.inv okeNext(Standar dPipeline.java: 566)
    at org.apache.cata lina.valves.Cer tificatesValve. invoke(Certific atesValve.java: 246)
    at org.apache.cata lina.core.Stand ardPipeline.inv okeNext(Standar dPipeline.java: 564)
    at org.apache.cata lina.core.Stand ardPipeline.inv oke(StandardPip eline.java:472)
    at org.apache.cata lina.core.Conta inerBase.invoke (ContainerBase. java:943)
    at org.apache.cata lina.core.Stand ardContext.invo ke(StandardCont ext.java:2343)
    at org.apache.cata lina.core.Stand ardHostValve.in voke(StandardHo stValve.java:18 0)
    at org.apache.cata lina.core.Stand ardPipeline.inv okeNext(Standar dPipeline.java: 566)
    at org.apache.cata lina.valves.Err orDispatcherVal ve.invoke(Error DispatcherValve .java:170)
    at org.apache.cata lina.core.Stand ardPipeline.inv okeNext(Standar dPipeline.java: 564)
    at org.apache.cata lina.valves.Err orReportValve.i nvoke(ErrorRepo rtValve.java:17 0)
    at org.apache.cata lina.core.Stand ardPipeline.inv okeNext(Standar dPipeline.java: 564)
    at org.apache.cata lina.core.Stand ardPipeline.inv oke(StandardPip eline.java:472)
    at org.apache.cata lina.core.Conta inerBase.invoke (ContainerBase. java:943)
    at org.apache.cata lina.core.Stand ardEngineValve. invoke(Standard EngineValve.jav a:174)
    at org.apache.cata lina.core.Stand ardPipeline.inv okeNext(Standar dPipeline.java: 566)
    at org.apache.cata lina.core.Stand ardPipeline.inv oke(StandardPip eline.java:472)
    at org.apache.cata lina.core.Conta inerBase.invoke (ContainerBase. java:943)
    at org.apache.cata lina.connector. http.HttpProces sor.process(Htt pProcessor.java :1012)
    at org.apache.cata lina.connector. http.HttpProces sor.run(HttpPro cessor.java:110 7)
    at java.lang.Threa d.run(Thread.ja va:534)
  • Silvio Bierman

    #2
    Re: Limited number of objects in Java?


    "Patrick" <PatrickRThomas @hotmail.com> wrote in message
    news:3529b9ab.0 308251420.6d6af 73@posting.goog le.com...[color=blue]
    > I'm using Jakarta-POI to create a huge Excel spreadsheet. I get the
    > error below when the spreadsheet grows to a large size. It seems to
    > have something to do with the number of "cell" objects that I create.
    > If I destroy other objects that I don't need any more, then I can
    > create more "cell" objects. Unfortunately, I cannot destroy any more
    > of my other objects without breaking the program. This does not appear
    > to be a problem that is specific to Jakarta-POI. I had the same
    > problem with my own custom objects, but in that case I was able to get
    > around the problem by only keeping a small number of those objects in
    > memory at any given time. I'm debugging this program through JBuilder
    > 7 using Tomcat 4.0. Perhaps this is a problem with Tomcat and not with
    > Java? Any help would be appreciated.
    >
    > StandardWrapper Valve[invoker]: Servlet.service () for servlet invoker
    > threw exception
    > javax.servlet.S ervletException : Invoker service() exception
    > javax.servlet.S ervletException : Invoker service() exception
    > at[/color]
    org.apache.cata lina.servlets.I nvokerServlet.s erveRequest(Inv okerServlet.jav a
    :504)[color=blue]
    > at[/color]
    org.apache.cata lina.servlets.I nvokerServlet.d oPost(InvokerSe rvlet.java:216)[color=blue]
    > at javax.servlet.h ttp.HttpServlet .service(HttpSe rvlet.java:760)
    > at javax.servlet.h ttp.HttpServlet .service(HttpSe rvlet.java:853)
    > at[/color]
    org.apache.cata lina.core.Appli cationFilterCha in.internalDoFi lter(Applicatio n
    FilterChain.jav a:247)[color=blue]
    > at[/color]
    org.apache.cata lina.core.Appli cationFilterCha in.doFilter(App licationFilterC h
    ain.java:193)[color=blue]
    > at[/color]
    org.apache.cata lina.core.Stand ardWrapperValve .invoke(Standar dWrapperValve.j a
    va:243)[color=blue]
    > at[/color]
    org.apache.cata lina.core.Stand ardPipeline.inv okeNext(Standar dPipeline.java: 5
    66)[color=blue]
    > at[/color]
    org.apache.cata lina.core.Stand ardPipeline.inv oke(StandardPip eline.java:472)[color=blue]
    > at org.apache.cata lina.core.Conta inerBase.invoke (ContainerBase. java:943)
    > at[/color]
    org.apache.cata lina.core.Stand ardContextValve .invoke(Standar dContextValve.j a
    va:190)[color=blue]
    > at[/color]
    org.apache.cata lina.core.Stand ardPipeline.inv okeNext(Standar dPipeline.java: 5
    66)[color=blue]
    > at[/color]
    org.apache.cata lina.valves.Cer tificatesValve. invoke(Certific atesValve.java: 2
    46)[color=blue]
    > at[/color]
    org.apache.cata lina.core.Stand ardPipeline.inv okeNext(Standar dPipeline.java: 5
    64)[color=blue]
    > at[/color]
    org.apache.cata lina.core.Stand ardPipeline.inv oke(StandardPip eline.java:472)[color=blue]
    > at org.apache.cata lina.core.Conta inerBase.invoke (ContainerBase. java:943)
    > at[/color]
    org.apache.cata lina.core.Stand ardContext.invo ke(StandardCont ext.java:2343)[color=blue]
    > at[/color]
    org.apache.cata lina.core.Stand ardHostValve.in voke(StandardHo stValve.java:18 0
    )[color=blue]
    > at[/color]
    org.apache.cata lina.core.Stand ardPipeline.inv okeNext(Standar dPipeline.java: 5
    66)[color=blue]
    > at[/color]
    org.apache.cata lina.valves.Err orDispatcherVal ve.invoke(Error DispatcherValve .
    java:170)[color=blue]
    > at[/color]
    org.apache.cata lina.core.Stand ardPipeline.inv okeNext(Standar dPipeline.java: 5
    64)[color=blue]
    > at[/color]
    org.apache.cata lina.valves.Err orReportValve.i nvoke(ErrorRepo rtValve.java:17 0
    )[color=blue]
    > at[/color]
    org.apache.cata lina.core.Stand ardPipeline.inv okeNext(Standar dPipeline.java: 5
    64)[color=blue]
    > at[/color]
    org.apache.cata lina.core.Stand ardPipeline.inv oke(StandardPip eline.java:472)[color=blue]
    > at org.apache.cata lina.core.Conta inerBase.invoke (ContainerBase. java:943)
    > at[/color]
    org.apache.cata lina.core.Stand ardEngineValve. invoke(Standard EngineValve.jav a
    :174)[color=blue]
    > at[/color]
    org.apache.cata lina.core.Stand ardPipeline.inv okeNext(Standar dPipeline.java: 5
    66)[color=blue]
    > at[/color]
    org.apache.cata lina.core.Stand ardPipeline.inv oke(StandardPip eline.java:472)[color=blue]
    > at org.apache.cata lina.core.Conta inerBase.invoke (ContainerBase. java:943)
    > at[/color]
    org.apache.cata lina.connector. http.HttpProces sor.process(Htt pProcessor.java :
    1012)[color=blue]
    > at[/color]
    org.apache.cata lina.connector. http.HttpProces sor.run(HttpPro cessor.java:110 7
    )[color=blue]
    > at java.lang.Threa d.run(Thread.ja va:534)[/color]

    Jakarta POI keeps all data for an Excel sheet in memory. It is obvious that
    the maximal size of your heap (what size did you set for the process?) will
    limit the size of the Excel sheet.

    Does anyone know of a good pure Java Excel generation library that can
    stream its output directly using a (kind of) constant amount of memory?

    Regards,

    Silvio Bierman


    Comment

    • Ryan C

      #3
      Re: Limited number of objects in Java?

      Silvio, try the Formula One e.Spreadsheet Engine from ReportingEngine s
      (www.reportingengines.com.

      "Silvio Bierman" <sbierman@idfix .nl> wrote in message news:<3f4a8e20$ 0$49102$e4fe514 c@news.xs4all.n l>...[color=blue]
      > "Patrick" <PatrickRThomas @hotmail.com> wrote in message
      > news:3529b9ab.0 308251420.6d6af 73@posting.goog le.com...[color=green]
      > > I'm using Jakarta-POI to create a huge Excel spreadsheet. I get the
      > > error below when the spreadsheet grows to a large size. It seems to
      > > have something to do with the number of "cell" objects that I create.
      > > If I destroy other objects that I don't need any more, then I can
      > > create more "cell" objects. Unfortunately, I cannot destroy any more
      > > of my other objects without breaking the program. This does not appear
      > > to be a problem that is specific to Jakarta-POI. I had the same
      > > problem with my own custom objects, but in that case I was able to get
      > > around the problem by only keeping a small number of those objects in
      > > memory at any given time. I'm debugging this program through JBuilder
      > > 7 using Tomcat 4.0. Perhaps this is a problem with Tomcat and not with
      > > Java? Any help would be appreciated.
      > >
      > > StandardWrapper Valve[invoker]: Servlet.service () for servlet invoker
      > > threw exception
      > > javax.servlet.S ervletException : Invoker service() exception
      > > javax.servlet.S ervletException : Invoker service() exception
      > > at[/color]
      > org.apache.cata lina.servlets.I nvokerServlet.s erveRequest(Inv okerServlet.jav a
      > :504)[color=green]
      > > at[/color]
      > org.apache.cata lina.servlets.I nvokerServlet.d oPost(InvokerSe rvlet.java:216)[color=green]
      > > at javax.servlet.h ttp.HttpServlet .service(HttpSe rvlet.java:760)
      > > at javax.servlet.h ttp.HttpServlet .service(HttpSe rvlet.java:853)
      > > at[/color]
      > org.apache.cata lina.core.Appli cationFilterCha in.internalDoFi lter(Applicatio n
      > FilterChain.jav a:247)[color=green]
      > > at[/color]
      > org.apache.cata lina.core.Appli cationFilterCha in.doFilter(App licationFilterC h
      > ain.java:193)[color=green]
      > > at[/color]
      > org.apache.cata lina.core.Stand ardWrapperValve .invoke(Standar dWrapperValve.j a
      > va:243)[color=green]
      > > at[/color]
      > org.apache.cata lina.core.Stand ardPipeline.inv okeNext(Standar dPipeline.java: 5
      > 66)[color=green]
      > > at[/color]
      > org.apache.cata lina.core.Stand ardPipeline.inv oke(StandardPip eline.java:472)[color=green]
      > > at org.apache.cata lina.core.Conta inerBase.invoke (ContainerBase. java:943)
      > > at[/color]
      > org.apache.cata lina.core.Stand ardContextValve .invoke(Standar dContextValve.j a
      > va:190)[color=green]
      > > at[/color]
      > org.apache.cata lina.core.Stand ardPipeline.inv okeNext(Standar dPipeline.java: 5
      > 66)[color=green]
      > > at[/color]
      > org.apache.cata lina.valves.Cer tificatesValve. invoke(Certific atesValve.java: 2
      > 46)[color=green]
      > > at[/color]
      > org.apache.cata lina.core.Stand ardPipeline.inv okeNext(Standar dPipeline.java: 5
      > 64)[color=green]
      > > at[/color]
      > org.apache.cata lina.core.Stand ardPipeline.inv oke(StandardPip eline.java:472)[color=green]
      > > at org.apache.cata lina.core.Conta inerBase.invoke (ContainerBase. java:943)
      > > at[/color]
      > org.apache.cata lina.core.Stand ardContext.invo ke(StandardCont ext.java:2343)[color=green]
      > > at[/color]
      > org.apache.cata lina.core.Stand ardHostValve.in voke(StandardHo stValve.java:18 0
      > )[color=green]
      > > at[/color]
      > org.apache.cata lina.core.Stand ardPipeline.inv okeNext(Standar dPipeline.java: 5
      > 66)[color=green]
      > > at[/color]
      > org.apache.cata lina.valves.Err orDispatcherVal ve.invoke(Error DispatcherValve .
      > java:170)[color=green]
      > > at[/color]
      > org.apache.cata lina.core.Stand ardPipeline.inv okeNext(Standar dPipeline.java: 5
      > 64)[color=green]
      > > at[/color]
      > org.apache.cata lina.valves.Err orReportValve.i nvoke(ErrorRepo rtValve.java:17 0
      > )[color=green]
      > > at[/color]
      > org.apache.cata lina.core.Stand ardPipeline.inv okeNext(Standar dPipeline.java: 5
      > 64)[color=green]
      > > at[/color]
      > org.apache.cata lina.core.Stand ardPipeline.inv oke(StandardPip eline.java:472)[color=green]
      > > at org.apache.cata lina.core.Conta inerBase.invoke (ContainerBase. java:943)
      > > at[/color]
      > org.apache.cata lina.core.Stand ardEngineValve. invoke(Standard EngineValve.jav a
      > :174)[color=green]
      > > at[/color]
      > org.apache.cata lina.core.Stand ardPipeline.inv okeNext(Standar dPipeline.java: 5
      > 66)[color=green]
      > > at[/color]
      > org.apache.cata lina.core.Stand ardPipeline.inv oke(StandardPip eline.java:472)[color=green]
      > > at org.apache.cata lina.core.Conta inerBase.invoke (ContainerBase. java:943)
      > > at[/color]
      > org.apache.cata lina.connector. http.HttpProces sor.process(Htt pProcessor.java :
      > 1012)[color=green]
      > > at[/color]
      > org.apache.cata lina.connector. http.HttpProces sor.run(HttpPro cessor.java:110 7
      > )[color=green]
      > > at java.lang.Threa d.run(Thread.ja va:534)[/color]
      >
      > Jakarta POI keeps all data for an Excel sheet in memory. It is obvious that
      > the maximal size of your heap (what size did you set for the process?) will
      > limit the size of the Excel sheet.
      >
      > Does anyone know of a good pure Java Excel generation library that can
      > stream its output directly using a (kind of) constant amount of memory?
      >
      > Regards,
      >
      > Silvio Bierman[/color]

      Comment

      Working...