<div dir="ltr">Hi list,<div><br></div><div><br></div><div>I'm running a tiling server which is a bit unusual: it's a Java-based web server which calls the MapServer 7.0.4 shared library using JNI and the swig bindings. </div><div><br></div><div>Works mostly fine, but I now have a problem with too many open files. This is for a layer where I use MapServer to display raster data. The input file is a large TIFF file, output format is PNG. I'm using a small MapScript file to specify things like the output projection and format,.</div><div><br></div><div>For each tile I generate, I dynamically specify the input TIFF file (which is a radar image and changes every 5 minutes).. My Java code is something like</div><div><br></div><div>mapObj map = new mapObj(mapFileName);<br></div><div>map.getLayer(0).setData(currentFile);<br></div><div>map.setExtent(...)</div><div><div>imageObj img = map.draw();</div><div>byte[] tile = img.getBytes();</div></div><div><br></div><div><br></div><div>This produces the PNG images that I want, but the problem is that file connections to the .tiff file remain open (as I could verify with 'lsof'), and after a while this becomes a problem. </div><div><br></div><div>My question: can I somehow close the data source after generating the PNG? I tried setting the data source to null, or calling the layer's delete() function, but that did not seem to have any effect.</div><div><br></div><div><br></div><div>Alternatively, I guess I could call GDAL directly from Java to generate my PNGs, but it's not very clear to me how to do that.</div><div><br></div><div>Thanks</div><div><br></div><div>Erik</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br><div><br></div><div><br></div></div></div>