TNguyen said:
From the perspective of a utility like top
Top is darned handy, but you shouldn't optimize for any given tool.
Understand what the tool is measuring and decide if it's important to you
(note: top's VIRT and RES numbers probably should be important to you most of
the time, but not because they're in top, just because OS memory allocated and
resident is important).
would having a file open and continuously write to it without closing it
increase the memory usage?
Not usually. You can write many gigs to a file without using any more
memory for the VM. There may be files or filesystems where this is not true
(some sort of virtual filesystem that lives in the VM, maybe?), but if you're
seeing memory grow, it's far more likely you're leaking memory (leaking
object references, usually, through a misplaced or hidden static) when
reading/generating/writing the data than that the actual write is using
memory.