[Rd] Problem with a regular expression.

Peter Langfelder peter.langfelder at gmail.com
Thu Aug 17 01:27:56 CEST 2017


FWIW, I tried it on my linux box. The memory use shot through the roof, the
system crawled to a halt due to constant swapping, and after a minute or so
top showed memory use of 47GB, at which point I killed the R process. On
linux at least R is not frozen but the strsplit call gobbles up memory (and
does not seem to end) which makes it look like it's frozen.

Peter

> sessionInfo()
R version 3.4.1 Patched (2017-08-11 r73090)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Fedora 26 (Twenty Six)

Matrix products: default
BLAS: /usr/local/atlas/lib/libtatlas.so
LAPACK: /usr/local/lib64/R-3.4.1-patched-atlas-parallel/lib/libRlapack.so

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=en_US.UTF-8       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

loaded via a namespace (and not attached):
[1] compiler_3.4.1



On Wed, Aug 16, 2017 at 3:31 PM, Chris Triggs <cm.triggs at auckland.ac.nz>
wrote:

> Hi...
>
> I have come upon a problem with a regular expression which causes base-R
> to freeze.  I have reproduced the phenomenon on several machines running R
> under Windows 10, and also under OSX  on different Apple MACs.
>
> The minimal example is:-
> Oldterm is a vector of characters, e.g. "A", "B", "A", "*", "B"
> The regular expression is "\\\\)"
>
> The call which freezes R is
> strsplit(Oldterm, "\\\\)" )
>
> Thomas - after he had reproduced the problem - suggested that I submit it
> to r-devel.
>
> Best wishes....
>            Chris Triggs
>
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

	[[alternative HTML version deleted]]



More information about the R-devel mailing list