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

Add swap memory column #217

Open
jojo2357 opened this issue Apr 28, 2024 · 23 comments · May be fixed by #372
Open

Add swap memory column #217

jojo2357 opened this issue Apr 28, 2024 · 23 comments · May be fixed by #372
Labels
enhancement New feature or request

Comments

@jojo2357
Copy link
Contributor

jojo2357 commented Apr 28, 2024

Problem

When I am deep into using swap, I cant figure out what process to kill since the memory reported does not account for memory swapped out. I therefore want to know exactly how much memory each process/app is demanding even when my 128 GiB swap partition is nearly full.

Possible Solution

Add the option to have a swap memory column, and/or a swap+memory column so I can pick which metric to keep track of

@jojo2357 jojo2357 added the enhancement New feature or request label Apr 28, 2024
@nokyan
Copy link
Owner

nokyan commented Apr 28, 2024

Hi, thanks for the issue.
This should be possible, I'll look into it.

@jojo2357
Copy link
Contributor Author

I presume you are using /proc/pid/stat for that memory, and according to this so there is an entry for total memory, swap and resident

@nokyan
Copy link
Owner

nokyan commented Sep 30, 2024

Hi, do you mind checking the swap-columns branch out?

@nokyan nokyan linked a pull request Oct 8, 2024 that will close this issue
@jojo2357
Copy link
Contributor Author

Ill get on it soon 🫡

@jojo2357
Copy link
Contributor Author

it wouldnt build in builder out of the box. Requested extension org.freedesktop.Sdk.Extension.rust-stable/x86_64/47 not installed and reinstalling SDK's did nothing

@nokyan
Copy link
Owner

nokyan commented Oct 11, 2024

it wouldnt build in builder out of the box. Requested extension org.freedesktop.Sdk.Extension.rust-stable/x86_64/47 not installed and reinstalling SDK's did nothing

Oh yeah, I recognize that error, I believe that message is a Flatpak bug. What Flatpak actually wants is org.gnome.Sdk//47 and org.gnome.Platform//47, installing that should make the build work.

@nokyan
Copy link
Owner

nokyan commented Oct 20, 2024

Have you had the chance to try it out again yet?

@jojo2357
Copy link
Contributor Author

I just tried it, and it doesnt work. I get no apps nor processes with the following spam:

failed to fill whole buffer
   0: anyhow::error::<impl core::convert::From<E> for anyhow::Error>::from
             at resources/_build/cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.89/src/backtrace.rs:27:14
   1: <core::result::Result<T,F> as core::ops::try_trait::FromResidual<core::result::Result<core::convert::Infallible,E>>>::from_residual
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/result.rs:1989:27
   2: resources::utils::process::Process::all_data
             at resources/src/utils/process.rs:99:13
   3: resources::ui::window::MainWindow::gather_refresh_data
             at resources/src/ui/window.rs:493:13
   4: resources::ui::window::MainWindow::periodic_refresh_all::{{closure}}::{{closure}}
             at resources/src/ui/window.rs:694:28
   5: std::sys::backtrace::__rust_begin_short_backtrace
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sys/backtrace.rs:152:18
   6: std::thread::Builder::spawn_unchecked_::{{closure}}::{{closure}}
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/thread/mod.rs:538:17
   7: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/panic/unwind_safe.rs:272:9
   8: std::panicking::try::do_call
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:557:40
   9: std::panicking::try
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:521:19
  10: std::panic::catch_unwind
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panic.rs:350:14
  11: std::thread::Builder::spawn_unchecked_::{{closure}}
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/thread/mod.rs:537:30
  12: core::ops::function::FnOnce::call_once{{vtable.shim}}
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/ops/function.rs:250:5
  13: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/alloc/src/boxed.rs:2070:9
  14: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/alloc/src/boxed.rs:2070:9
  15: std::sys::pal::unix::thread::Thread::new::thread_start
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sys/pal/unix/thread.rs:108:17
  16: <unknown>
  17: clone

@nokyan
Copy link
Owner

nokyan commented Oct 20, 2024

I just tried it, and it doesnt work. I get no apps nor processes with the following spam:

failed to fill whole buffer
   0: anyhow::error::<impl core::convert::From<E> for anyhow::Error>::from
             at resources/_build/cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.89/src/backtrace.rs:27:14
   1: <core::result::Result<T,F> as core::ops::try_trait::FromResidual<core::result::Result<core::convert::Infallible,E>>>::from_residual
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/result.rs:1989:27
   2: resources::utils::process::Process::all_data
             at resources/src/utils/process.rs:99:13
   3: resources::ui::window::MainWindow::gather_refresh_data
             at resources/src/ui/window.rs:493:13
   4: resources::ui::window::MainWindow::periodic_refresh_all::{{closure}}::{{closure}}
             at resources/src/ui/window.rs:694:28
   5: std::sys::backtrace::__rust_begin_short_backtrace
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sys/backtrace.rs:152:18
   6: std::thread::Builder::spawn_unchecked_::{{closure}}::{{closure}}
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/thread/mod.rs:538:17
   7: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/panic/unwind_safe.rs:272:9
   8: std::panicking::try::do_call
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:557:40
   9: std::panicking::try
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:521:19
  10: std::panic::catch_unwind
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panic.rs:350:14
  11: std::thread::Builder::spawn_unchecked_::{{closure}}
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/thread/mod.rs:537:30
  12: core::ops::function::FnOnce::call_once{{vtable.shim}}
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/ops/function.rs:250:5
  13: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/alloc/src/boxed.rs:2070:9
  14: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/alloc/src/boxed.rs:2070:9
  15: std::sys::pal::unix::thread::Thread::new::thread_start
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sys/pal/unix/thread.rs:108:17
  16: <unknown>
  17: clone

Builder has created a folder called .gnome-builder somewhere in your projects folder. Could you please run .gnome-builder/projects/resources/install/host/libexec/resources/resources-processes -o -r in your projects folder and send me the output?

@jojo2357
Copy link
Contributor Author

It won't run, but neither will resources it complains about 'GLIBC_2.39' not found which i am 100% sure is because this is Ubuntu 22.04

also the path was .gnome-builder/projects/resources/flatpak/staging/x86_64-swap-columns/files/libexec/resources which i found with find

@nokyan
Copy link
Owner

nokyan commented Oct 20, 2024

It won't run, but neither will resources it complains about 'GLIBC_2.39' not found which i am 100% sure is because this is Ubuntu 22.04

also the path was .gnome-builder/projects/resources/flatpak/staging/x86_64-swap-columns/files/libexec/resources which i found with find

Oh, that's quite unfortunate. Does prod Resources from Flathub run?

@jojo2357
Copy link
Contributor Author

I can run it from flatpak and thru builder just not from cli (or at least idk how)

@nokyan
Copy link
Owner

nokyan commented Oct 20, 2024

Can you run ldd --version?

@jojo2357
Copy link
Contributor Author

Ubuntu GLIBC 2.35-0ubuntu3.8

@nokyan
Copy link
Owner

nokyan commented Oct 20, 2024

It's odd that prod Resources runs, I didn't change anything related to libc since then I believe. :/
I'll check it out in a VM tomorrow.

@jojo2357
Copy link
Contributor Author

Prod runs fine from builder, i didnt check if prod runs from cli but i highly doubt it.

This branch runs in builder, I just can't run your command since, pursuant to the last point, it wont run from cli

@jojo2357
Copy link
Contributor Author

jojo2357 commented Oct 20, 2024

Color me a big fat liar...main doesnt work* anymore. It definitely used to on my machine.

@jojo2357
Copy link
Contributor Author

Git bisect blames c7f3a5e3469d01d473d7f6eaec22a1b90af824da for my error.

@jojo2357
Copy link
Contributor Author

Okay I patched adw and libc back to pre c7f3a5 and it looks GREAT

@jojo2357
Copy link
Contributor Author

I started up a very memory-hungry application and now I know what programs got swapped out and how much total mem I could free by killing them.

Only other suggestion is to add the option for a swap + mem column, or total mem i guess. I can sort by one or the other but I want the sum (for hopefully obvious reasons)

@jojo2357
Copy link
Contributor Author

An example:

image

It would be insane if DataGrip managed less memory than libreoffice or lollypop, but in reality it is just mostly swapped out

@nokyan
Copy link
Owner

nokyan commented Oct 21, 2024

An example:

image

It would be insane if DataGrip managed less memory than libreoffice or lollypop, but in reality it is just mostly swapped out

I'm not sure, I don't want to have too many columns if you know what I mean and I also pledged to not introduce any new translatable strings until the next release. Maybe I'll include it later.

@jojo2357
Copy link
Contributor Author

I'm not sure, I don't want to have too many columns if you know what I mean

I see the sum as crucial, otherwise i can sort by resident, by swap, but not both so I would have to check both sorts to see the culprit of my high mem + swap usage

I also pledged to not introduce any new translatable strings until the next release. Maybe I'll include it later.

Later is better than never for sure. Maybe kick the whole can down the road?

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

Successfully merging a pull request may close this issue.

2 participants