Open gaborcsardi opened 6 years ago
+1 for set_cpu_affinity! Just needs taskset
on Linux, but dunno about other OSs
Calling external commands is not great in R, and small Docker containers might not have taskset
. But there is an easy API for this on Linux: https://linux.die.net/man/2/sched_getaffinity
There is also API for it on Windows: https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getprocessaffinitymask
It seems impossible on macOS, though.
I was just looking for the memory_full_info
function. I understand it's still in the process of implementation, right?
@brianmsm Well, these are things I might implement in the future, or things I am happy to get help with.
What do you need from memory_full_info()
? There is ps_memory_info()
with some basic information:
❯ ps::ps_memory_info()
rss vms pfaults pageins
81592320 419098476544 5515 42
Well, following the psutil documentation in python, the memory_full_info()
function allows access to uss (Unique Set Size), pss (Proportional Set Size) and swap information. In my case I am very interested in getting the swap memory information used in a particular process.
@brianmsm Happening here: https://github.com/r-lib/ps/pull/122, Linux seems to be working well.
Great! Thank you very much, I'll be waiting for you to join the main branch :D
CPU affinity happening here, FYI: https://github.com/r-lib/ps/pull/123
nice()
(get + set)ionice()
rlimit()
io_counters()
num_ctx_switches()
num_fds()
num_handles()
threads()
cpu_percent()
cpu_affinity()
cpu_num()
memory_full_info()
memory_percent()
memory_maps()
open_files()
connections()
wait()