[Geoserver-devel] Re: Out of memory bug

Wow, that's a big table. The short answer is to increase the amount of
memory in your jvm. To do that I think there is some option in the tomcat
configuration files or you can also try setting an environment variable -
JAVA_OPTS=-Xms256m to set it to 256 megs. I'm not sure what the default
is. This will obviously take up more of your memory, and is a less than
ideal solution. You also could try switching to resin, which is free for
academic use, and is generally faster and handles memory a bit better.

There are also a few more little things I'm planning on doing to handle
memory a bit better with postgis. If you're interested in doing them
yourself in geotools I can point you in the right direction. One is to
make the postgis jdbc result set be forward only, not to hold it in
memory, which is not yet done. The other is to use WKB instead of WKT,
which will cut down on overhead a bit as well.

Chris

On Wed, 25 Feb 2004, Mehdi ESSID wrote:

hello,
I have a problem with geoserver when I ask a large volume of data. for
exemple if I send a query to extract all the data contained in a postgis
table (170 000 tuples) I obtain the next error :
java.lang.IllegalStateException: "getOutputStream()" a déjà été appelé pour
cette réponse
  at
org.apache.coyote.tomcat4.CoyoteResponse.getWriter(CoyoteResponse.java:614)
  at
org.apache.coyote.tomcat4.CoyoteResponseFacade.getWriter(CoyoteResponseFacad
e.java:173)
  at
org.vfny.geoserver.servlets.AbstractService.send(AbstractService.java:446)
  at
org.vfny.geoserver.servlets.AbstractService.sendError(AbstractService.java:4
87)
  at
org.vfny.geoserver.servlets.AbstractService.doService(AbstractService.java:3
63)
  at
org.vfny.geoserver.servlets.AbstractService.doGet(AbstractService.java:195)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
  at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
  at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
  at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:256)
  at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
  at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
  at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
  at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
  at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
  at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
  at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
  at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
  at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
  at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
  at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:171)
  at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
  at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
)
  at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
  at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
  at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
  at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
  at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
  at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
  at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
  at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
  at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
  at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:392)
  at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
  at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:619)
  at java.lang.Thread.run(Thread.java:536)
Is there any solution
?THANKS---------------------------------------------------------------------
--------
Mehdi ESSID
LSIS - Université de Provence - CMI,
Technopôle de château Gombert
39, rue Joliot-Curie
F-13453 Marseille Cedex 13
TEL : 04 91 11 35 41 / 04 91 05 60 57
FAX : 04 91 11 36 92

--

I could not help but notice that this problem was to do with AbstractService and may be addressed with the ServiceStratagy used by GeoServer.

Quickly:
BUFFER
- stores the entire response in memory first, before sending it off to the user (may run out of memory)

SPEED
- outputs directly to the response (and cannot recover in the case of an error)

FILE
- outputs to the local filesystem first, before sending it off to the user

I imagine you are using SPEED right now as it appears to be the default.

The AbstractService.init is used to set this sort of thing up, currently it checks:
    String stgyKey = context.getInitParameter("serviceStratagy");

For one of BUFFER, SPEED, FILE.

So you can change this in your web.xml file(near the top):

<web-app>
  <display-name>GeoServer</display-name>
  <description>Web Mapping and Feature Services</description>
  <context-param>
    <param-name>serviceStratagy</param-name>
    <param-value>FILE</param-value>
  </context-param>

The current value if SPEED.

Hope this helps...or I could be completely wrong.

Jody

Chris Holmes wrote:

org.vfny.geoserver.servlets.AbstractService.send(AbstractService.java:446)
at
org.vfny.geoserver.servlets.AbstractService.sendError(AbstractService.java:4
87)
at
org.vfny.geoserver.servlets.AbstractService.doService(AbstractService.java:3
63)
at
   

when I done the above modifications (I replace SPEED by FILE in web.xml) I
obtain this Service Exception :

UNCAUGHT EXCEPTION : java.lang.OutOfMemoryError.

----- Original Message -----
From: "Jody Garnett" <jgarnett@anonymised.com>
To: "Chris Holmes" <cholmes@anonymised.com>
Cc: "Mehdi ESSID" <essid@anonymised.com>;
<geoserver-devel@lists.sourceforge.net>
Sent: Wednesday, February 25, 2004 7:20 PM
Subject: Re: [Geoserver-devel] Re: Out of memory bug

I could not help but notice that this problem was to do with
AbstractService and may be addressed with the ServiceStratagy used by
GeoServer.

Quickly:
BUFFER
- stores the entire response in memory first, before sending it off to
the user (may run out of memory)

SPEED
- outputs directly to the response (and cannot recover in the case of an
error)

FILE
- outputs to the local filesystem first, before sending it off to the user

I imagine you are using SPEED right now as it appears to be the default.

The AbstractService.init is used to set this sort of thing up, currently
it checks:
    String stgyKey = context.getInitParameter("serviceStratagy");

For one of BUFFER, SPEED, FILE.

So you can change this in your web.xml file(near the top):

> <web-app>
> <display-name>GeoServer</display-name>
> <description>Web Mapping and Feature Services</description>
> <context-param>
> <param-name>serviceStratagy</param-name>
> <param-value>FILE</param-value>
> </context-param>

The current value if SPEED.

Hope this helps...or I could be completely wrong.

Jody

Chris Holmes wrote:

org.vfny.geoserver.servlets.AbstractService.send(AbstractService.java:446)

>> at

org.vfny.geoserver.servlets.AbstractService.sendError(AbstractService.java

:4

>>87)
>> at

org.vfny.geoserver.servlets.AbstractService.doService(AbstractService.java

:3

>>63)
>> at
>>
>>

heloo,
is there any way to write a WFS query to extract the set of roads which
cross buildings (we suppose that we have the two feature collections roads
and buildings)
PS : As I know we can't express more than a collection in a query.
THANKS

heloo,
is there any way to write a WFS query to extract the set of roads which
cross buildings (we suppose that we have the two feature collections roads
and buildings)
PS : As I know we can't express more than a collection in a query.

I don't know of a good way, I think it's beyond the scope of wfs at the
moment. The best that I can think of to try is to do a getFeature on the
roads and then make a multilinestring geometry out of their geometries,
and then do a wfs query on buildings with the crosses operator on the
linestrings. Or something to that effect.

Chris

THANKS

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--