-
Notifications
You must be signed in to change notification settings - Fork 5
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
Could not open process: The parameter is incorrect. (error 87) #9
Comments
Hi. Probably the process doesn't exist by the time you request the information. E.g. it exits too soon. |
Hi All, Please find the details, we are trying to capture the CPU and Memory utlization of a process id where the process is created by below Program
The above code works file for the process which is created by std.process.pipeProcess where same is failing for the process created by std.process.pipeShell.
if we replace this with the parent process id it works , the same do not work using child process id, we actually need the CUP and Memory of the child process in both the case.(std.process.pipeProcess , std.process.pipeShell)
|
I couldn't reproduce it. I wrote the following program: import std.stdio;
import resusage.memory;
import resusage.cpu;
import std.process;
import std.format;
void main()
{
CPUWatcher cpuInfo;
string appPath = "testd.exe";
//auto result = std.process.pipeProcess([appPath]);
auto result = std.process.pipeShell(appPath);
int spwanPID = (result.pid).processID;
writeln("Pid: ", spwanPID);
cpuInfo = new ProcessCPUWatcher(spwanPID);
auto memInfo = processMemInfo(spwanPID);
writeln("[MEMORY]: %s bytes\t".format(memInfo.usedRAM));
writeln("[CPU]: %s%%\t".format(cpuInfo.current()));
wait(result.pid);
} With testd.exe being another D program int main()
{
return 0;
} If you provide reproducible case, I can look at it. |
Please try the below code ` void main () {
} |
The process you're trying to get the information from has already exited when you request the cpu time info. |
Hi All,
I am trying to use the package resusage, and I am getting the below error message, googled for this error and tried all the solution provided still facing the same issue, hence requesting your help.
Solution Provided
dism.exe /image:C: /cleanup-image /revertpendingactions dism.exe /online /cleanup-image /startcomponentcleanup
Error
std.windows.syserror.WindowsException@resusage\common.d(25): Could not open process: The parameter is incorrect. (error 87)
From,
Vino.B
The text was updated successfully, but these errors were encountered: