Is there a way to find cpu and memory% of java process using cygwin?
I tried ps aux -W |awk '{print $2,$3,$4}'|grep PID,but the value is coming as 0.
Any help would be appreciated.
You can't. Java machine is NOT a cygwin program, it is a standard windows program so use a windows tool like sysinternals
https://learn.microsoft.com/en-us/sysinternals/downloads/process-utilities
Under Cygwin you'll need to use Windows commands.
For the basics, tasklist /v is fairly like ps.
For stats like CPU percentage, typeperf does the job, but its output isn't pretty!
typeperf "\Process(Java*)\% Processor Time" -sc 1
https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-xp/bb490960(v=technet.10)
Related
I'm using CentOS 7.5.1804.
Right after booting-up, the operating system delays.
For example, when I try to write "python" in a terminal,
first I write "pyt" and press .
I have to wait a few seconds for the OS to interpolate to "python".
This phenomenon occurs just after booting-up.
After a few days later, this phenomenon goes away.
Does anyone know a clue to solve this problem?
The bit when you press pyt-"tab" is part of bash-completion package as the command completion happens after you typed the full command. So the cause has to be investigated starting with bash. My educated guess is that some process or I/O is keeping the system busy.
You can start with some generic system information tools as soon as the system start:
uptime to see the system load
vmstat -n 1 to check the status of the CPU
ps aux to check running processes
iotop to check for I/O
systemctl list-jobs to show running jobs in systemd
and based on the result of them perform deeper analysis.
Another thing might be the access to the disk slowing down the systemt at startup. Where is the machine running?
I don't know about fixing — there are all kinds of things that could go cause delays. But I can offer a few tips to investigate.
The first step to investigate is to run set -x to get a trace of the commands that the shell executes to generate the completions. Watch where it pauses.
do you have the issue with different auto-completion? if its only python you can time the execution of your command
time python
you can watch if you have some problems at launch with redirect standar output and error to a file.
strace python 2>&1 launch.log
take a strace at boot and one later then you can check if there is difference between:
diff -u delays.log delays2.log | grep ^+
hope it can help.
I'm writing a bash script to be executed on both Windows and Linux machines from the terminal. One of the lines calls Rscript, a program for executing .R programs. The issue is that in Linux, the command is simply Rscipt, whereas in Windows, it is Rscript.exe. Is there any way to modify the program such that it'll run seamlessly on both Windows and Linux operating systems?
Thank you.
You can name any Unix executable with suffix .exe, no problem too... the first bits in Linux are magic bits which indicates the real type of one file.
or
Simply use perl or python scripts, Perl and python can work both on Windows and Linux.
I'm trying utilize threads in my Perl script, running on Windows 7. I'm unable to compile the script as Perl wasn't built with thread support when initially installed (the previous user installed Perl without thread support).
How can I rebuild Perl with thread support?
Thanks.
Most people use ActivePerl or Strawberry Perl on Windows, both of which have thread support enabled.
That said, I find it very odd that you have a Perl without thread support on Windows. I think you could be mistaken. You can check if your Perl has thread support by using
>perl -v | find "built for"
... for MSWin32-x86-multi-thread-64int
or more directly with
>perl -V:usethreads
usethreads='define';
First check whether multithreading is supported by your perl or not :
#!/usr/bin/perl
use Config;
$Config{useithreads} or die('This perl interpreter does not support execution threads.');
print "This perl interpreter supports multithreading\n";
does anyone know how to produce a similar result?(essentially tying the windows terminal to the open program)
For example, when you run "emacs" in bash (or another linux terminal) it will produce an output into the open terminal until the program is terminated (or silenced with emacs &)
I want to be able to reproduce this effect on windows, but have no idea how, running start(and similar commands) will only run the program in a new window, with a hidden command line, detached from the cmd line process.
You need the /B flag:
start /B myprogram
(Of course, this will only work with programs that actually use the console. If the program doesn't generate console output, this won't magically make it do so.)
You can do that by first installing Cygwin and then running emacs from Cygwin.
Cygwin is a collection of tools which provide functionality similar to a Linux distribution on Windows.
try typing edit into a windows command shell, it's actually a better program than notepad. there are versions of vi, emacs, for windows and dos, you could try any of them.
ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/
http://www.vim.org/download.php#pc
I've just tried using gdb on BackTrack Linux and I must say that its awesome. I wonder how gdb in backtrack is configured to act this way.
When I set a breakpoint, all the register values, a part of the stack, a part of the data section and the next 10-15 instructions to be executed are printed. The same happens when I step or next through the instructions.
I find this amazing and would love to have this on my Ubuntu machine too; how could I go about doing this?
They seem to be using this .gdbinit file:
https://github.com/gdbinit/Gdbinit/blob/master/gdbinit
I'm guessing that this is done using a post command hook:
http://sourceware.org/gdb/current/onlinedocs/gdb/Hooks.html#Hooks
inside of a system wide gdbinit:
http://sourceware.org/gdb/onlinedocs/gdb/System_002dwide-configuration.html
which may or may not reference shell commands and/or use gdb python scripts.
try:
strace gdb /bin/echo 2>&1 | grep gdbinit