From maechler at stat.math.ethz.ch  Wed May  4 09:44:07 2016
From: maechler at stat.math.ethz.ch (Martin Maechler)
Date: Wed, 4 May 2016 09:44:07 +0200
Subject: [Rd] Is it possible to increase MAX_NUM_DLLS in future R
	releases?
In-Reply-To: <BLU436-SMTP7203A01BDD638D733608F0CD790@phx.gbl>
References: <BLU436-SMTP7203A01BDD638D733608F0CD790@phx.gbl>
Message-ID: <22313.43079.748521.575179@stat.math.ethz.ch>

>>>>> Qin Zhu <qinzhu at outlook.com>
>>>>>     on Mon, 2 May 2016 16:19:44 -0400 writes:

    > Hi,
    > I?m working on a Shiny app for statistical analysis. I ran into this "maximal number of DLLs reached" issue recently because my app requires importing many other packages.

    > I?ve posted my question on stackoverflow (http://stackoverflow.com/questions/36974206/r-maximal-number-of-dlls-reached <http://stackoverflow.com/questions/36974206/r-maximal-number-of-dlls-reached>). 

    > I?m just wondering is there any reason to set the maximal number of DLLs to be 100, and is there any plan to increase it/not hardcoding it in the future? It seems many people are also running into this problem. I know I can work around this problem by modifying the source, but since my package is going to be used by other people, I don?t think this is a feasible solution. 

    > Any suggestions would be appreciated. Thanks!
    > Qin

Increasing that number is of course "possible"... but it also
costs a bit (adding to the fixed memory footprint of R). 

I did not set that limit, but I'm pretty sure it was also meant
as reminder for the useR to "clean up" a bit in her / his R
session, i.e., not load package namespaces unnecessarily. I
cannot yet imagine that you need > 100 packages | namespaces
loaded in your R session. OTOH, some packages nowadays have a
host of dependencies, so I agree that this at least may happen
accidentally more frequently than in the past. 

The real solution of course would be a code improvement that
starts with a relatively small number of "DLLinfo" structures
(say 32), and then allocates more batches (of size say 32) if
needed. 

Patches to the R sources (development trunk in subversion at
https://svn.r-project.org/R/trunk/ ) are very welcome! 

Martin Maechler
ETH Zurich  &  R Core Team



[Rd] Is it possible to increase MAX_NUM_DLLS in future R releases?
Martin Maechler