If you use cpan (1) in a system with limited memory, for example, in a lower-level hosting account, probably CPAN.pm cannot match the index of the module in memory or takes up most of the memory you have. CPAN storage is now huge, so what used to be a small index file is quite large. In fact, this is the most annoying part of the process for me, as it takes a lot of time to download and upload.
cpanminus (cpanm) does different things using the MetaCPAN API to find the information they need. It has a very small amount of memory.
Or you can run something else at the same time that you are taking up memory.
source share