I would distinguish two main categories of procedures / approaches:
- A procedure loads some data into main memory, performs some operation, and saves the result to the disk.
- A procedure runs as a filter reading a data stream and producing a new data stream as output, which is saved on the fly. When the end of the input stream is reached, the procedure terminates.
In the first case (e.g. reading, editing, saving a document), memory usage can be linear (or even quadratic or more) in the size of the input data: the largest size for the input data will be determined by the amount of available memory. You can use this approach when your input data is small enough wrt the available memory.
In the seconds case (e.g. filtering relevant information from a large log file) even a linear memory usage can be undesirable, since it is easy to run out of memory as soon as the input stream is large enough. For problems of category 2 I would only accept a solution that can run in constant (stack and heap) memory.
Whether your solution falls into category 1 or 2 can depend on the (expected) size of the data. Take for example sorting. If you need to sort 100 MB of strings you can just load the data into main memory and use an in-memory algorithm. On the other hand, if you need to sort 1 TB of data, you should rather consider an algorithm that uses constant main memory (like some implementations of merge sort).