halfcountplus has asked for the wisdom of the Perl Monks concerning the following question:

I just got a small "unmanaged" VPS account (debian lenny) and tried to use CPAN.pm on it, but it continually fails here:
Fetching with LWP: http://www.perl.org/CPAN/modules/02packages.details.txt.gz Going to read '/root/.cpan/sources/modules/02packages.details.txt.gz' Database was generated on Sat, 18 Jul 2009 22:27:04 GMT ...................................Killed
I've never had a problem with it before; my resources are limited (128mb RAM) but I don't really believe that is the problem. Any idea why this might happen?

Replies are listed 'Best First'.
Re: CPAN.pm always killed on VPS
by grantm (Parson) on Jul 21, 2009 at 03:33 UTC
    You may be running out of memory. I'm pretty sure CPAN.pm slurps that whole file into a single data structure.
      You're probably right. I've never dealt with this before! But right after the kill /var/log/messages gets littered with a bunch of (incomprehensible to me) memory stuff, starting with
      Jul 21 03:46:47 localhost kernel: oom-killer: gfp_mask=0x280d2, order= +0 Jul 21 03:46:47 localhost kernel: Jul 21 03:46:47 localhost kernel: Call Trace: Jul 21 03:46:47 localhost kernel: [<ffffffff80258cd0>] out_of_memory+0 +x2e/0x182
      I guess that's not so incomprehensible =/ Thanks!

      Probably there is no way out of that...

        I haven't used CPAN::SQLite, but its intent is to reduce the amount of memory required.

        Update: I've just enabled it per the documentation; the CPAN shell uses a third the memory that it did before.