Open ndrubins opened 7 years ago
This is because the function works with recursion which is not very robust to large nested trees. One solution is to rewrite the function using a loop (something I will not do any time soon). Another is to see if there are ways to increase the stack, but I didn't play with it and am not sure if it would work for your tree. Sorry.
Thanks
@ndrubins, from the help page for options()
:
‘expressions’: sets a limit on the number of nested expressions
that will be evaluated. Valid values are 25...500000 with
default 5000. If you increase it, you may also want to start
R with a larger protection stack; see ‘--max-ppsize’ in
‘Memory’. Note too that you may cause a segfault from
overflow of the C stack, and on OSes where it is possible you
may want to increase that. Once the limit is reached an
error is thrown. The current number under evaluation can be
found by calling ‘Cstack_info’.
Thanks
Just to say, exactly the same error is preventing me from running color_branches
on a tree with 10k members.
Increasing expressions
has not had any effect, and as this is a managed instance (R Workbench server) I don't think I can increase the C stack myself (if it's possible at all).
Just to say, exactly the same error is preventing me from running
color_branches
on a tree with 10k members.Increasing
expressions
has not had any effect, and as this is a managed instance (R Workbench server) I don't think I can increase the C stack myself (if it's possible at all).
Hi, increasing expressions indeed has no effect. The key is to increase the C stack usage limit at the operating system level introduced here and here.
If you only need to use terminal R, then adding "ulimit -s 819200" (100 times larger than the default 8192 KB) to your .bashrc file before next login is good enough.
If you rely on the Rstudio server (or perhaps Rstudio desktop), then you need to change the c stack usage limit at the system level. The key is to change /etc/systemd/user.conf
and /etc/systemd/system.conf
. Changing /etc/security/limits.conf
seems less important.
sudo vim /etc/systemd/user.conf
add DefaultLimitSTACK=819200000
sudo vim /etc/systemd/system.conf
add DefaultLimitSTACK=819200000
sudo vim /etc/security/limits.conf
add * hard stack 819200
and * soft stack 819200
Do not forget to remove the #
at the beginning of the line to uncomment the line in the configuration files.
Then the computer needs to be restarted to make the change into effect. Simply restarting Rstudio server won't work.
Type system("ulimit -s")
in your Rstudio server to see the change of c stack usage limit.
Hi
dendextend
team,I have a:
'dendrogram' with 2 branches and 4872 members total, at height 10.11295
(calleddendro
) for which I'm calling:get_branches_heights(dendro, include_leaves=T)
On my linux cluster I'm getting this error message:Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
And on my mac I'm getting this error message:Error: C stack usage 7969900 is too close to the limit
Does this look familiar to you? Any idea what can be done to avoid this?Thanks a lot