NetBSD-Users archive

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

Re: Memory leaks?



Frédéric Fauberteau <triaxx%NetBSD.org@localhost> writes:

> When I boot the VM, the memory usage is correct: 218M. I do not know
> what the SIZE column is. The manual of top says it is the total size
> of the process. I am surprised that an instance of sshd is about 80
> MB. I see the RES column seems more consistent with what I could
> expect: 4368 KB for sshd seems correct. My question is probably naive,
> but what is the difference? What could sshd do with 76 MB of memory?

[please try to not line wrap or otherwise change command output; it's
hard to read when wrapped]

SIZE is the total amount of address space.  It is not necessarily
associated with physical memory.

RESrefers to the amount of physical memory allocated to the process.

SIZE can be bigger from mapping files and not necessarily accessing
the.  Or from memory that has been allocated, but not used in a really
long time and then paged out.

I would recommend reading the top and ps man pages slowly and
carefully.  There's a lot going on here.


You can also use 'pstat -s' to watch the use of "swap" space.
Confusingly, swap space is used for paging.  (On 2BSD on PDP-11s, it was
actually swap, where an entire process was written out, and there was no
virtual memory.)

I would recommend looking at pstat -s hourly (script/log) and also
looking at various ps outputs.  The first step is to figure out which
process is growing.   You may be able to restart it every day, as a
workaround, before debugging the leak.   Or you may find that the above
theory of a single leaking process is wrong and it's more complicated.

But sshd being 80M/5M size/rss is not unsuual.

  After some days (~7), I get a more problematic memory usage. I see
  that rspamd took a little weight, but it is not alarming. However, I
  have now 2647 MB of active memory and 2328 of them are for files. I
  would be very grateful of any advice that could help me to understand
  what is the issue and which program consumes so much memory.

That does not look problematic, merely not explained.   No swap is used,
there is free memory, and there is a lot caching files.

I am not really clear on what "active" means in top.   (Not saying it's
not usefu

I would use ps, not top, since it shows everythign, and then maybe sort.


Home | Main Index | Thread Index | Old Index