Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regarding the issue with memory usage on jtop #600

Open
kerokero-kero opened this issue Jan 9, 2025 · 2 comments
Open

Regarding the issue with memory usage on jtop #600

kerokero-kero opened this issue Jan 9, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@kerokero-kero
Copy link

kerokero-kero commented Jan 9, 2025

Hi everyone,
Based on the formula in the code, it seems that "Used" does not include "GPU sh," which means my actual memory usage might be "Used + GPU sh," right? What I’d like to understand is how to interpret these memory statistics to determine the actual resources required to run my services. For example, in the following case:

Used: 28.1 G
GPU sh: 12.3 G
Buffers: 287 M
Cached: 15.1 G
Free: 18.2 G
TOT: 61.4 G
According to the formula in the code:
Used = TOT - Free - (Buffers + Cached) = 61.4 - 18.2 - (0.287 + 15.1)

This raises some questions:

  1. It seems that "Used" cannot fully represent the memory required to run services. Would the actual required memory be Used + GPU sh?
  2. If not, does "GPU sh" mean memory is allocated but not actively used?
  3. If "GPU sh" is actively used, where would it be reflected? For example, would "Free" decrease or "Cached" increase?
  4. If there isn’t enough memory available for "GPU sh" allocation, would the program crash?
@kerokero-kero kerokero-kero added the enhancement New feature or request label Jan 9, 2025
@rbonghi
Copy link
Owner

rbonghi commented Jan 14, 2025

Hi @kerokero-kero

Apologize for my late reply.

It seems that "Used" cannot fully represent the memory required to run services. Would the actual required memory be Used + GPU sh?

Not all used memory shows the same, like htop and top. It really depends on what "used" means for you. I spent a lot of time making the output familiar like other monitors (but if you know there are better ways to measure this output, I would be really happy to implement it :-) )
An example:

My best understanding to make the memory reasonable is to use the equation:
MemUsed = MemTotal - (Buffers + Cached)
but the MemTotal - MemUsed != MemFree and you can notice similar outputs in other monitors.

If not, does "GPU sh" mean memory is allocated but not actively used?

GPU Sh is the memory used by the GPU. The GPU inside an NVIDIA Jetson doesn't have proper memory (like a discrete GPU) but uses the same memory as the CPU. They, in fact, share the same memory.
GPU Sh means is the memory actively used from the GPU.

If "GPU sh" is actively used, where would it be reflected? For example, would "Free" decrease or "Cached" increase?

Here there is a missing data visualization comparing what is currently shown from the /proc/meminfo and what is really utilized on a Jetson.
The /proc/meminfo doesn't include the GPU memory utilization in the MemFree part; it's like a memory that "doesn't exist," and this is the reason I don't use this variable when I show the output on the system.

If there isn’t enough memory available for "GPU sh" allocation, would the program crash?

In my tests, I see a Jetson crash, but I'm happy to know it is not happening anymore. :-)

If something is not well explained or you have suggestions, I'm really happy to help you.

Best,
Raffaello

@kerokero-kero
Copy link
Author

Hi @rbonghi ,

First of all, thank you for your detailed response. However, I still have some questions. You mentioned that GPU Sh represents the memory actively used by the GPU. Does this mean it could potentially increase over time with prolonged service usage, rather than being a fixed value?

Previously, when using non-shared memory devices like consumer-grade GPUs, I relied on nvidia-smi to monitor memory usage, which appeared to remain constant. However, I’ve noticed that GPU Sh sometimes increases unexpectedly. For example, when the service first starts, GPU Sh usage is 27GB, but over time, it grows to 35GB. This leaves me uncertain about how to determine the actual GPU memory requirements for my service on the Jetson AGX Orin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants