http://qs1969.pair.com?node_id=81776


in reply to A story of a Perl Monk and Problem

... if he wrote this perl script to load the contents of said directory into an array, that the script would have a huge memory foot print.

Have you determined whether an occassional huge memory footprint is actually significant in the system you're building? Reading the directory into an array is simple to implement and test. If the CGI is going to be invoked relatively infrequently (e.g., a few times a minute) on a machine with adequate memory, the impact of the footprint might be insignificant in the grand scheme of things. Smaller footprint alternatives are more difficult to implement, and might be more compute intensive.

  • Comment on (dws)Re: A story of a Perl Monk and Problem

Replies are listed 'Best First'.
Re: (dws)Re: A story of a Perl Monk and Problem
by lindex (Friar) on May 20, 2001 at 03:12 UTC

    Good Question, ++
    Well on the perticular machine in question, I am developing this tool as a mod_perl application, so any memory used by perl is shared with apache
    Thus if perl has an array in memory that is about 2.3mb then so does apache, this is not acceptable for me.
    As well as the machine does web serving and other file processing, so good CPU and MEM stats are a must.


    Brought to you by that crazy but lovable guy... lindex
      Thus if perl has an array in memory that is about 2.3mb then so does apache, this is not acceptable for me.

      Is mod_perl mandatory, or can you do this particular task with a CGI?

        Yup its about as manitory as it gets.
        Iam writing the file manager on top of an allready existing mod_perl application, on a web server that doesn't do anything else but server mod_perl handlers.

        Brought to you by that crazy but lovable guy... lindex