Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CPAN shell runs out of memory. How can I give it more memory on Unix?

Tags:

unix

aix

perl

cpan

I'm getting an Out of memory! message for all installs. I've never used cpan before and I'm not really sure how it works. I did a ulimit on the /.cpan directory and it resulted in unlimited. Here's what I'm looking at:

[/usr/bin]# perl -MCPAN -e shell
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v1.7602)
ReadLine support available (try 'install Bundle::CPAN')

cpan> install Term::Readline
CPAN: Storable loaded ok
Going to read /.cpan/Metadata
Going to read /.cpan/sources/authors/01mailrc.txt.gz
Going to read /.cpan/sources/modules/02packages.details.txt.gz
  Database was generated on Tue, 19 Jun 2012 11:51:03 GMT
CPAN: HTTP::Date loaded ok

  There's a new CPAN.pm version (v1.9800) available!
  [Current version is v1.7602]
  You might want to try
    install Bundle::CPAN
    reload cpan
  without quitting the current session. It should be a seamless upgrade
  while we are running...

Out of memory!
Terminal does not support GetHistory.
Lockfile removed.
like image 330
pnkflydgr Avatar asked Jun 19 '12 19:06

pnkflydgr


2 Answers

This is not about increasing memory, but maybe a solution for you.

You can try use cpanm instead of cpan, so:

This will install cpanm for you

$ curl -L http://cpanmin.us | perl - --self-upgrade

and after you can install modules e.g.:

$ cpanm Task::Plack

cpanm needs much less memory.

like image 73
jm666 Avatar answered Nov 04 '22 13:11

jm666


Another reason is that the user you are using to run cpan has a limit on the amount of memory it can use. Issue these commands to use all available memory:

ulimit -m unlimited
ulimit -d unlimited
like image 21
Terry Bochaton Avatar answered Nov 04 '22 14:11

Terry Bochaton