GithubHelp home page GithubHelp logo

Comments (6)

MichaIng avatar MichaIng commented on May 29, 2024 1

My two cents:

  • The virtual memory is indeed no practical indicator for actual memory consumption of processes. Depending on the process, e.g. when heavily threaded like a webserver or database which can but not does currently handle a lot of concurrent connections, the virtual memory may be magnitudes of orders higher than what the process actually takes. It is more like an upper bounding of what it may use. And it includes shared memory, like loaded shared libraries which are in fact used by multiple different processes concurrently. In case of multiple websever of PHP handler child processes, e.g. the virtual memory of each child process includes the shared features, like PHP OPcache, which is indeed shared across all PHP handler child processes and often makes the major parts of the whole PHP process memory consumption (virtual and physical).
  • The resident memory consumption is much closer to what a single process really currently uses in memory. Adding up all resident memory values of the whole process list does not 100% precisely but close enough tell you how much memory is used and how much memory is hence available, before the OOM killer kicks in. Doing so with the virtual memory gives you quickly values much (sometimes magnitudes of orders) higher than the actual total system memory, and hence does not help at all to evaluate whether you need to tweak your services or upgrade your RAM modules (on non-SBCs 😉) or not. And that practical aspect, to know from the memory consumption whether action is advised or not, is what IMHO is most important when showing these stats at all.

from dietpi-dashboard.

ravenclaw900 avatar ravenclaw900 commented on May 29, 2024

Hi,
The dashboard uses the virtual memory of a process, which is, according to the docs of the system information library that I use, "the total amount of memory used by the process". htop by default uses resident set size, which is, also according to the docs, "the amount of non-swapped physical memory used by the process". If, in htop, you enable the M_VIRT column under Setup, you should get the same value as the dashboard.

from dietpi-dashboard.

igorkulman avatar igorkulman commented on May 29, 2024

Would it be possible maybe to add a switch to toggle between those 2 values?

from dietpi-dashboard.

ravenclaw900 avatar ravenclaw900 commented on May 29, 2024

Alright, that makes sense, and it will match up completely with htop now. I'll switch it over to the resident memory.

from dietpi-dashboard.

ravenclaw900 avatar ravenclaw900 commented on May 29, 2024

Done with 9d96c90.

from dietpi-dashboard.

igorkulman avatar igorkulman commented on May 29, 2024

Thanks

from dietpi-dashboard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.