help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: "unable to open pipe" problem


From: George White
Subject: RE: "unable to open pipe" problem
Date: Fri, 26 Feb 1999 08:46:32 -0400 (AST)

On Thu, 25 Feb 1999, Pulley Joe Wade DR NUWCDIVNPT wrote:

> Is there a way to do this garbage collection while running? Or is this
> something that has to be done within the code?  I try to "clear" all the
> variables that I don't need, but that seems to make no difference
> whatsoever.  When I run my script, I end up maxing out at about 190Mb of
> memory usage.  When the process will no longer open a pipe, I can save the
> workspace, quit and restart octave, and reload the workspace.  Everything is
> present (seemingly) and the memory usage drops from 190Mb to only about 30.
> So am I stuck or what?
> Thanks
> Dr. Joe Wade Pulley
> Naval Undersea Warfare Center, Division Newport
> 1176 Howell Street, Building 1320, Code 3113
> Newport, RI 02841
> (401)-832-8690 or 1-800-669-6892 Ext. 28690

Garbage collection is part of a different approach to memory management
such as that used by R.  Most implementations that use this approach
do periodic garbage collection when memory gets low, and also provide
a way to request a garbage collection.  You usually notice a significant
"pause" while a garbage collection runs, although there are incremental
methods that attempt to minimize this effect.

With octave, at least on SGI, once you have allocated memory it does not
get released until the program exits.  Clearing unused variables will only
help by making that space available for reuse, and I don't know how
effective this is (e.g., fragmentation may result in lots of free memory
but no chunks large enough to hold the desired data). You may have some
intermediate step that is allocating the 190M -- perhaps there is a
different algorithm with a smaller footprint.  My work typically uses 20M
arrays.  It is not unusual to see about the same profile you report:  in
the process of transforming input array A to output array B the total
allocation for octave grows to around 200M, but at the end only the array
B is left in all that memory and popen fails.  The result is that I have
to write B to a file and then process it with the program that generates
the final output format.  Having to exit octave plus the extra disk I/O
means the task takes significantly longer than it would if popen was
available (and negates one of the advantages of octave over matlab!).

--
George White <address@hidden> Halifax, Nova Scotia



reply via email to

[Prev in Thread] Current Thread [Next in Thread]