Encountered this gem when I was attempting to install an overly simple/normal perl module (HTML::Template, though all will fail as a result of this). This actually has nothing to do with cPanel, the kernel, or CPAN. Instead, you’re actually hitting a PAM ulimit that is exhausting all of the available reserved memory required to install this module.
Catching error: “Out of memory during \”large\” request for 1052672 bytes, total sbrk() is 106149888 bytes at /usr/local/lib/perl5/5.8.8/CPAN.pm line 5337.\cJ” at /usr/local/lib/perl5/5.8.8/CPAN.pm line 359
CPAN::shell() called at /usr/local/bin/cpan line 198
Going to read /home/xxxxx/.cpan/sources/authors/01mailrc.txt.gz
Out of memory during request for 16400 bytes, total sbrk() is 106149888 bytes!
If you su into the user you’re attempting to install this module for and snap a ulimit -m (max memory size, rss) you’ll see:
max memory size (kbytes, -m) 200000
This is actually limiting the user to a specific amount of available memory, causing the install to fail miserably.
Here’s what you do to fix. Edit /etc/security/limits.conf and allow the user account to use an unlimited amount of memory (temporarily, if you wish):
username hard rss 0
Now do a ulimit -m:
max memory size (kbytes, -m) unlimited
Now, try again:
cpan -i ‘HTML::Template’
And watch it install.Tweet