Skip to content
Prev 19052 / 29559 Next

raster/rgdal- problem: Too many open files (Linux)

On 06-Aug-13 21:35, Roger Bivand wrote:
Roger, thanks for having a look at this.
I just checked with an older version, and it seems the problem was 
introduced more or less at the same time as a valgrind issue was fixed 
in revision 456. Running the example above worked with R 2.14.0 and 
rgdal 0.8-5 (sessionInfo below), but failed when upgrading rgdal (and 
sp). The problem seems to be in the C++ code (I already tried to revert 
the R code of GDAL.close to 0.8-5, without any difference), which I am 
unfortunately not able to debug.

As there is no quick fix at the moment, I just thought it would be good 
to summarize the possible workarounds for other people who encounter 
this problem:
- Split up the process in smaller problems
- Increase the number of possible file connections (the standard on 
Linux seems to be 1024, but I have not seen any reason for not 
increasing this to e.g. 40.000, as currently on our system)
- Do parallel processing (will work better as each sub-process will have 
its own list of file connections).

Best wishes,
Jon


R version 2.14.0 (2011-10-31)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
  [7] LC_PAPER=C                 LC_NAME=C
  [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] rgdal_0.8-5   raster_2.0-41 sp_1.0-5

loaded via a namespace (and not attached):
[1] grid_2.14.0    lattice_0.20-0