<div dir="ltr">Based upon your description, I can't guess as to the cause of the memory leak(?). Can you post the query and provide some information (spatial extent, # of features) about the rasters (tile size, # of bands, in-db or out-db) and the geometries (same SRID of raster, maximum # of vertices per polygon)?<div><br></div><div>-bborie</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 2, 2015 at 11:39 AM, Bergenroth, Brandon <span dir="ltr"><<a href="mailto:bbergenroth@rti.org" target="_blank">bbergenroth@rti.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I have thousands of polygons that I clip/intersect with various rasters and calculate area-weighted values, etc.<br>
<br>
I have created a function which returns a table of attributes and it works like a charm when calling it for a specific polygon and raster.  However when I call this function over and over again in a single session, the memory used by the PostgreSQL process continues to climb and instead of the function returning in the few seconds it normally does, it starts to take longer and longer and will just churn on one polygon for a long time to the point of never returning.  Now if I open another session and run that particular polygon it comes right back so I know it is not the data or the function.<br>
<br>
If I batch up the polygons and execute them in a new connection each time then they all finish in a timely manner.<br>
<br>
It would be hard for me to produce a test case given the amount of data I'm working with, but is there anything I am obviously missing here?  It is not such a burden to do each one in a new connection but that is obviously not ideal.<br>
<br>
Thanks for any suggestions.<br>
<span class="HOEnZb"><font color="#888888"><br>
Brandon Bergenroth<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
</font></span></blockquote></div><br></div>