in reply to Variable stack size in Perl.

The simple answer is that the size of memory available to Perl (under NT/AS at least) is (roughly)

(memory size on the server you are running on) + (the size of the swapper defined)

- (amount of memory that is used by perl itself + memory used by other programs on the server)

However, if the size of the file is a concern (and if this is a hosted domain especially), then you should think about accessing it contents in smaller chunks rather than all at once. There are many ways you can do this, but deciding or advising which one is right for your application will depend on knowing a lot more about what you are doing, and how you are doing it.

You might take a look at the various Tie::* modules that come as a part of your standard distribution and/or the various flavours of DBI on CPAN.


Nah! You're thinking of Simon Templar, originally played (on UKTV) by Roger Moore and later by Ian Ogilvy

Replies are listed 'Best First'.
Re: Re: Variable stack size in Perl.
by kindsnail (Initiate) on Nov 11, 2002 at 13:56 UTC
    I want really to thank you, UK, j'm remained surprised: you're been quick and complete. But j'd like to understand better this think: would it tell that if the server is busied by other weavy processes, could it succeed that the reading of even a small file could cause Perl to raise an "out of memory" error? Always, if you know, is there an amount of memory that is affordably available, guaranted by ActivePerl?

      Essentially, no. There is no minimum amount of memory guarenteed to be available to Perl.

      The restriction, if there is one, is the amount of memory available to the OS itself. If you are getting "out of memory" when trying to load a small file into memory, this is an OS configuration problem, not a problem with Perl itself.

      It means that either the server has too little memory installed for the use to which it is put. Or,

      Not enough room has been allocated to the swap space. Or,

      That the servers discs are so full that it cannot expand it swap space to accomodate even small growth. Check the free space on the drive(s) on which the swapper has space allocated.

      If either of these latter two is the cause, it is almost certain that the first is true as well or that the box has simply too much running on it.


      Nah! You're thinking of Simon Templar, originally played (on UKTV) by Roger Moore and later by Ian Ogilvy
Re: Re: Variable stack size in Perl.
by kindsnail (Initiate) on Nov 11, 2002 at 14:41 UTC
    Dear BrowserUk,
       j've noted that your answer contained links. Now after having followed them, j think to have no more other help need. The parameter "memory" of tie::file is set to 2.000.000 of bytes by default. It needs others ten years before it arrives to a size like that.

    Thank you, again.
    At next.