in reply to Re: Managing System Memory Resources
in thread Managing System Memory Resources

The reason I find creating files in 'chunks' and then later concatenating them 'clunky' is more that I now have to manage, within the subroutine that does all the db queries, a test of the size of the current 'temp' file, etc.

Certainly do-able, but I was hoping for less.

However, I did find some more information about the problem, thanks in part to browseruk who gave me the key words to google for (file caching solaris).

(I will update my OP and repeat the following info)

Under Solaris, to minimize I/O time, it sucks the entire open file into memory. I tested my program on the machine that had sufficient memory, so without swapping, the memory consumption now seems logical. (The test files were 15Meg, and the memory consumption was 15Meg). Also, when reopening a file for appending, the initial file will be loaded into memory. This is why closing and reopening a file in append mode did nothing.

Solaris 2.8 behaves nicely when swapping. (My test was run on Solaris 2.8). It does not swap out processes if it runs out of memory for I/O. Solaris 2.7, however, is not so nice. It does swap out processes if it needs more memory for I/O. This can cause the machine to spend more time swapping then working. Because my Solaris 2.7 workstation is low on memory, it can't hold the entire file in memory, so it starts swapping. Hence my original 20min program took 2 1/2 hours on the workstation.

There is a solution, it's called priority_paging, and supposely fixes the problem (haven't tried it yet).

Reference: http://www.princeton.edu/~psg/unix/Solaris/troubleshoot/ram.html, http://sunsolve.sun.com/pub-cgi/show.pl?target=content/content8 and http://www.sun.com/sun-on-net/performance/priority_paging.html

Sandy

Replies are listed 'Best First'.
Re^3: Managing System Memory Resources
by BrowserUk (Patriarch) on Jun 29, 2004 at 03:13 UTC

    I love it when a guess comes together:)


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    "Memory, processor, disk in that order on the hardware side. Algorithm, algoritm, algorithm on the code side." - tachyon
Re^3: Managing System Memory Resources
by dws (Chancellor) on Jun 28, 2004 at 15:44 UTC

    Solaris 2.8 behaves nicely when swapping. ... It does not swap out processes if it runs out of memory for I/O. Solaris 2.7, however, is not so nice.

    One approach to consider, if you're willing to support multiple strategies, is to make the decision to do file processing in-memory dependent on OS version.

      Now that I have a handle on the problem (i.e. it's an OS issue, not a perl issue), I will certainly have to consider the various options. The low memory Solaris 2.7 was supposed to be a backup to the higher end machine. Increasing the memory on the 2.7 machine, or upgrading to 2.8, or both, will most likely be our final solution.