process

GetProcessMemoryInfo PROCESS_MEMORY_COUNTERS_EX.PrivateUsage always 0

丶灬走出姿态 提交于 2021-02-07 14:23:50
问题 I'm using GetProcessMemoryInfo function to determine process memory usage by its PID. With regular PROCESS_MEMORY_COUNTERS all works fine, but I need PrivateUsage member, that exists only in extended structure PROCESS_MEMORY_COUNTERS_EX. There are couple of docs, that moved me to forcefully cast extended type to a basic one, otherwise my sample wont compile. I'm still able to get value from basic members, such as PeakWorkingSetSize, but PrivateUsage is always 0. I've even tried to redefine

GetProcessMemoryInfo PROCESS_MEMORY_COUNTERS_EX.PrivateUsage always 0

為{幸葍}努か 提交于 2021-02-07 14:21:05
问题 I'm using GetProcessMemoryInfo function to determine process memory usage by its PID. With regular PROCESS_MEMORY_COUNTERS all works fine, but I need PrivateUsage member, that exists only in extended structure PROCESS_MEMORY_COUNTERS_EX. There are couple of docs, that moved me to forcefully cast extended type to a basic one, otherwise my sample wont compile. I'm still able to get value from basic members, such as PeakWorkingSetSize, but PrivateUsage is always 0. I've even tried to redefine

What's the differences between a Process ID and a Process handle

那年仲夏 提交于 2021-02-07 13:13:51
问题 A process ID is a number that uniquely identifies a process. A process handle is also a number that uniquely identifys a process kernal object. Why do we need them both since either of them can identify a process. I think the answer may lie in the mapping relationship betweeen a process and a process kernel object. Is it true that more than one process kernel objects can be mapped to a single process? And each process kernel object has its own process handle. So that each of the process

Why the process is getting killed at 4GB?

与世无争的帅哥 提交于 2021-02-07 07:48:11
问题 I have written a program which works on huge set of data. My CPU and OS(Ubuntu) both are 64 bit and I have got 4GB of RAM. Using "top" (%Mem field), I saw that the process's memory consumption went up to around 87% i.e 3.4+ GB and then it got killed. I then checked how much memory a process can access using "uname -m" which comes out to be "unlimited". Now, since both the OS and CPU are 64 bit and also there exists a swap partition, the OS should have used the virtual memory i.e [ >3.4GB +

Linux: Processes and Threads in a Multi-core CPU

放肆的年华 提交于 2021-02-07 07:35:20
问题 Is it true that threads, compared to processes, are less likely to benefit from a multi-core processor? In other words, would the kernel make the decision of executing threads on a single core rather than on multiple cores? I'm talking about threads belonging to the same process. 回答1: I don't know how the (various) Linux scheduler handle this, but inter-thread communication gets more expensive when threads are running on different Cores. So the scheduler may decide to run threads of a process

Get CPU % of a particular process using powershell

穿精又带淫゛_ 提交于 2021-02-07 04:37:36
问题 I want to get the CPU usage % (not processor time) of a particular process using a powershell command. Example: (Windows 8 Task Manager) I want to get that 2.9% with a command. 回答1: Here is the correct answer which is support case then you have multiple processs with same name https://stackoverflow.com/a/34844682/483997 # To get the PID of the process (this will give you the first occurrance if multiple matches) $proc_pid = (get-process "slack").Id[0] # To match the CPU usage to for example

Check what programs are playing audio?

强颜欢笑 提交于 2021-02-07 03:55:48
问题 I am making a program and I want to find and mute programs that are playing audio so all you hear is mine. (This is an option for the program, nothing malicious about it) I have looked it up and I cannot seem to find a way to check what programs are playing audio (Much like windows does) I don't have any code examples of attempting this because id has no idea. In case someone misses reads or I don't word the above sentences correct I would like to find EVERY process with audio playing and

Check what programs are playing audio?

笑着哭i 提交于 2021-02-07 03:51:13
问题 I am making a program and I want to find and mute programs that are playing audio so all you hear is mine. (This is an option for the program, nothing malicious about it) I have looked it up and I cannot seem to find a way to check what programs are playing audio (Much like windows does) I don't have any code examples of attempting this because id has no idea. In case someone misses reads or I don't word the above sentences correct I would like to find EVERY process with audio playing and

Check what programs are playing audio?

夙愿已清 提交于 2021-02-07 03:50:36
问题 I am making a program and I want to find and mute programs that are playing audio so all you hear is mine. (This is an option for the program, nothing malicious about it) I have looked it up and I cannot seem to find a way to check what programs are playing audio (Much like windows does) I don't have any code examples of attempting this because id has no idea. In case someone misses reads or I don't word the above sentences correct I would like to find EVERY process with audio playing and

C#: get external shell command result line by line

戏子无情 提交于 2021-02-07 03:34:34
问题 I am writing a C# winform application that starts a second process to execute shell commands like "dir" and "ping". I redirect the second process's output so my app can receive the command result. It roughly works fine. The only problem is my winform app receives the command line output as a whole instead of line by line. For example, it has to wait for the external "ping" command to finish (which takes many seconds or longer) and then receives the whole output (many lines) at once. What I