Re: [Rd] Run garbage collector when too many open files

2018-08-07 Thread luke-tierney
On Tue, 7 Aug 2018, Jan van der Laan wrote: Dear Luke, Thanks. See below On 07-08-18 17:07, luke-tier...@uiowa.edu wrote: In R 3.5 and later you should not need to gc() -- that should happen automatically within the connections code. Could you elaborate on what has changed in R 3.5? As fa

Re: [Rd] Run garbage collector when too many open files

2018-08-07 Thread Jan van der Laan
Dear Luke, Thanks. See below On 07-08-18 17:07, luke-tier...@uiowa.edu wrote: In R 3.5 and later you should not need to gc() -- that should happen automatically within the connections code. Could you elaborate on what has changed in R 3.5? As far as I can tell my problem also occurs in R 3

Re: [Rd] [R-pkg-devel] Run garbage collector when too many open files

2018-08-07 Thread luke-tierney
In R 3.5 and later you should not need to gc() -- that should happen automatically within the connections code. Nevertheless, I would recommend redesigning your approach to avoid hanging onto open file connections as these are a scarce resource. You can keep around your temporary files without ha

Re: [Rd] [R-pkg-devel] Run garbage collector when too many open files

2018-08-07 Thread Jan van der Laan
Dear Uwe, (When replying to your message, I sent the reply to r-devel and not r-package-devel, as Martin Meachler suggested that this thread would be a better fit for r-devel.) Thanks. In the example below I used rm() explicitly, but in general users wouldn't do that. One of the reasons fo

[Rd] Run garbage collector when too many open files

2018-08-07 Thread Jan van der Laan
In my package [1] I open handles to temporary files from c++, pointer to the objects containing those handles are returned to R as external pointer objects. The files are deleted when the corresponding R-object is deleted and the garbage collector runs: a <- lvec(10, "integer") rm(a) Then