[Geoserver-users] close wfs transaction for out of memory error

Hi everyone,

In my project I HTTP POST geoserver’s wfs with the following code snippet ( i cut out some things)

<

wfs:Transaction service=“WFS” … >wfs:Insert<cite:tracks >cite:guid…</ cite:guid>cite:the_geom<gml:Point srsName=“urn:EPSG:geographicCRS:4979”><gml:coordinates decimal=“.” cs=“,” ts=" ">…,…,…</gml:coordinates ></gml:Point></cite:the_geom ></cite:tracks></wfs:Insert></ wfs:Transaction>

and now my server is getting an out of memory error, i know that this means there is not enough memory to hold all the objects created. How do i close the transaction in the xml when i am finished with it?

java.lang.OutOfMemoryError: allocLargeArray - Object size: 1048592, Num elements: 1048576

at java.io.BufferedOutputStream.(BufferedOutputStream.java:59)

at org.vfny.geoserver.servlets.FileStrategy.flush(FileStrategy.java:96)

at org.vfny.geoserver.servlets.AbstractService.doService(AbstractService.java:594)

at org.vfny.geoserver.servlets.AbstractService.doPost(AbstractService.java:447)

at org.geoserver.request.Dispatcher.post(Dispatcher.java:301)

at org.geoserver.request.Dispatcher.dispatch(Dispatcher.java:181)

at org.geoserver.request.Dispatcher.handleRequestInternal(Dispatcher.java:66)

at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:139)

at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)

at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:684)

at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:625)

at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:392)

at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:358)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:223)

at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)

at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)

at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)

at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:103)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)

at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3231)

at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)

at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)

at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2003)

at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1909)

at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1359)

at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)

at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)

Hi Dominique,

It is a very large insert?

I notice your GeoServer is configured to use "FileStrategy". While it is
the safest strategy, it is not great for performance as shown below with
the huge array allocation. YOu might confider changing it to
"PartialBufferStrategy". This can be done in the web.xml file. Are you
running jetty out of the box or in another web container.

-Justin

Dominique Bessette - Halsema wrote:

Hi everyone,

In my project I HTTP POST geoserver's wfs with the following code
snippet ( i cut out some things)

<

wfs:Transaction service="WFS" ... ><wfs:Insert><cite:tracks

<cite:guid>...</ cite:guid><cite:the_geom><gml:Point

srsName="urn:EPSG:geographicCRS:4979"><gml:coordinates decimal="."
cs="," ts=" ">...,...,..</gml:coordinates ></gml:Point></cite:the_geom

</cite:tracks></wfs:Insert></ wfs:Transaction>

and now my server is getting an out of memory error, i know that this
means there is not enough memory to hold all the objects created. How
do i close the transaction in the xml when i am finished with it?

*java.lang.OutOfMemoryError: allocLargeArray - Object size: 1048592, Num
elements: 1048576 *

        at java.io.BufferedOutputStream.<init>(BufferedOutputStream.java:59)

        at
org.vfny.geoserver.servlets.FileStrategy.flush(FileStrategy.java:96)

        at
org.vfny.geoserver.servlets.AbstractService.doService(AbstractService.java:594)

        at
org.vfny.geoserver.servlets.AbstractService.doPost(AbstractService.java:447)

        at org.geoserver.request.Dispatcher.post(Dispatcher.java:301)

        at org.geoserver.request.Dispatcher.dispatch(Dispatcher.java:181)

        at
org.geoserver.request.Dispatcher.handleRequestInternal(Dispatcher.java:66)

        at
org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:139)

        at
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)

        at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:684)

        at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:625)

        at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:392)

        at
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:358)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

        at
weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:223)

        at
weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)

        at
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)

        at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)

        at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)

        at
org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:103)

        at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)

        at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3231)

        at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)

        at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)

        at
weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2003)

        at
weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1909)

        at
weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1359)

        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)

        at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)

!DSPAM:4007,477d337d37012090977483!

------------------------------------------------------------------------

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

!DSPAM:4007,477d337d37012090977483!

------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4007,477d337d37012090977483!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

ok.. .so you if you find the web.xml for geoserver and change the
"serviceStrategy" context parameter to "PARIAL_BUFFER" it could very
well do the trick.

-Justin

Dominique Bessette - Halsema wrote:

I'm not running it on Jetty. My Geoserver is deployed as a web app on
the BEA Weblogic server.

On 1/3/08, *Justin Deoliveira* <jdeolive@anonymised.com
<mailto:jdeolive@anonymised.com>> wrote:

    Hi Dominique,

    It is a very large insert?

    I notice your GeoServer is configured to use "FileStrategy". While
    it is
    the safest strategy, it is not great for performance as shown below with
    the huge array allocation. YOu might confider changing it to
    "PartialBufferStrategy". This can be done in the web.xml file. Are you
    running jetty out of the box or in another web container.

    -Justin

    Dominique Bessette - Halsema wrote:
    > Hi everyone,
    >
    > In my project I HTTP POST geoserver's wfs with the following code
    > snippet ( i cut out some things)
    >
    > <
    >
    > wfs:Transaction service="WFS" ... ><wfs:Insert><cite:tracks
    >><cite:guid>...</ cite:guid><cite:the_geom><gml:Point
    > srsName="urn:EPSG:geographicCRS:4979"><gml:coordinates decimal="."
    > cs="," ts=" ">...,...,..</gml:coordinates ></gml:Point></cite:the_geom
    >></cite:tracks></wfs:Insert></ wfs:Transaction>
    >
    >
    > and now my server is getting an out of memory error, i know that this
    > means there is not enough memory to hold all the objects
    created. How
    > do i close the transaction in the xml when i am finished with it?
    >
    > *java.lang.OutOfMemoryError: allocLargeArray - Object size:
    1048592, Num
    > elements: 1048576 *
    >
    > at java.io.BufferedOutputStream
    .<init>(BufferedOutputStream.java:59)
    >
    > at
    > org.vfny.geoserver.servlets.FileStrategy.flush(FileStrategy.java:96)
    >
    > at
    > org.vfny.geoserver.servlets.AbstractService.doService
    (AbstractService.java:594)
    >
    > at
    >
    org.vfny.geoserver.servlets.AbstractService.doPost(AbstractService.java:447)
    >
    > at org.geoserver.request.Dispatcher.post(Dispatcher.java:301)
    >
    > at
    org.geoserver.request.Dispatcher.dispatch(Dispatcher.java:181)
    >
    > at
    >
    org.geoserver.request.Dispatcher.handleRequestInternal(Dispatcher.java:66)
    >
    > at
    >
    org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:139)
    >
    >
    > at
    >
    org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle
    (SimpleControllerHandlerAdapter.java:44)
    >
    >
    > at
    >
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:684)
    >
    > at
    > org.springframework.web.servlet.DispatcherServlet.doService
    (DispatcherServlet.java:625)
    >
    > at
    >
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:392)
    >
    > at
    > org.springframework.web.servlet.FrameworkServlet.doPost
    (FrameworkServlet.java:358)
    >
    > at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
    >
    > at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    >
    > at
    >
    weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:223)
    >
    >
    > at
    >
    weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java
    :125)
    >
    > at
    >
    weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
    >
    > at
    weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    >
    > at
    >
    weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
    >
    > at
    >
    org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java
    :103)
    >
    >
    > at
    >
    weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
    >
    > at
    >
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run
    (WebAppServletContext.java:3231)
    >
    >
    > at
    >
    weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    >
    > at
    > weblogic.security.service.SecurityManager.runAs
    (SecurityManager.java:121)
    >
    > at
    >
    weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2003)
    >
    > at
    > weblogic.servlet.internal.WebAppServletContext.execute
    (WebAppServletContext.java:1909)
    >
    > at
    >
    weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1359)
    >
    > at weblogic.work.ExecuteThread.execute(ExecuteThread.java
    :209)
    >
    > at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    >
    >
    >
    >
    >
    ------------------------------------------------------------------------

    >
    >
    -------------------------------------------------------------------------
    > This SF.net email is sponsored by: Microsoft
    > Defy all challenges. Microsoft(R) Visual Studio 2005.
    > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
    >
    > !DSPAM:4007,477d337d37012090977483!
    >
    >
    >
    ------------------------------------------------------------------------
    >
    > _______________________________________________
    > Geoserver-users mailing list
    > Geoserver-users@lists.sourceforge.net
    <mailto:Geoserver-users@lists.sourceforge.net>
    > https://lists.sourceforge.net/lists/listinfo/geoserver-users
    >
    >
    > !DSPAM:4007,477d337d37012090977483!

    --
    Justin Deoliveira
    The Open Planning Project
    http://topp.openplans.org

!DSPAM:4007,477d3f7b59893668746562!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org