0

Using Kubuntu 20.04, which is running from an USB stick. Therefore there is a /cow overlay file system mounted on /. The USB stick has a total capacity of 32 GB, But to the cow overlay file system only 16 GB were assigned. My computer has a RAM size of 32 GB (as shown by utility "free" in total).

The cause of my current state is, that I have forgotten to disable the internet connection.

Before, I have used aptitude to search, but I have not intentionally downloaded something. Overnight from the 16 GB in "cow" about 2 GB have gone used. df -Th -a shows "used" is grown from 21% to 33%.

Now I am investigating, who has done what.

For this I have running (for many hours) a self-written program wels_fullpath (based on bash globstar and **) over /, piping the output to sort (for sorting by time), and from sort to less. While this is running, I have to pay attention which memory is used for buffers of sort and of less. (I am neglecting sort in the moment).

For this I have continuously running the watch utility to observe the changes in df and free:

watch -d  "df -T -a >/tmp/WEx_df__2; diff -U0 /tmp/WEx_df__1 /tmp/WEx_df__2; free -w -h"

strace shows that wels_fullpath is working.

But neither in df nor in free are changes reported.

So the question came up, where in the list of df some continuously growing buffers should appear?

I have read the documentation to less and I have long googled in internet. There are some good articles regarding less and buffers. But nowhere is a description where in the FHS the less buffers should be seen and with what a name.

  • addendum:

A new question came up.

I have changed my calling sequence and do no longer use "less" here.

Nevertheless my question is of general importance for me.

And perhaps for the place where the buffers of less are, I have not written the appropriate term "storage". I have ment "in memory or on disk". less buffers should have an effect on either "free" or "df". And this should be noted in some documentatin.

Now my command chain is:

/.../wels_fullpath -d / 2>/dev/null | grep -v -e "^fd1" | sort -s -r -k7,8 >/tmp/WEx01

As I see in "top" ("htop" is not installed by default) the execution is yet on the very beginning:

top -p <PID>

shows:

PID USER PR NI VIRT RES

2159985 root 20 0 242132 235816

SHR S %CPU %MEM TIME+

3160 R 99.3 0.7 1634:33

COMMAND

wels_fullpath

In my program I use an array. And while reading the files in the source "/", they are written into the array. Thus VIRT and RES are continuously growing, ok.

But my perpetually running "watch" of "df" and "free" does not show these changes. The values in "free" varies by a very small amount up and down.

Thus my additional question is, please:

why the growing memory usage of my program is not reflected in "free"?

is there an utility in Linux, Kubuntu to analize and display a l l aspects of memory (like "df", "du")?

Regards antondhidh

Oh, excuse me. I have remembered and have found:

/proc/meminfo gives a good overview. pmap gives memory usage per process.

Sorry having bothered you.

Regards antondhidh

1
  • "I am neglecting sort in the moment." - You probably shouldn't. Unlike less, sort may indeed create temporary files on disk if the input becomes too big to sort in memory. Commented Apr 10, 2022 at 12:30

1 Answer 1

4

less doesn’t store buffers anywhere in the file system. Its buffers, configurable using the --buffers and --auto-buffers options, are kept in memory (potentially in swap).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .