Joined November 2014
·

Adit Saxena

London
·
·

Posted to Measuring memory usage in Ruby over 1 year ago

@rozzy probably you already noticed, this has to run in a ruby script as it gets the process id as input and provides memory usage as output. Some details: --- Backticks operator places your command in a shell script and returns it's result (there are many other variants, http://goo.gl/HGg2ee). --- The double dollar sign is a ruby method and retrieves the script's current process ID. --- The following code is a bash script which finds the memory usage of a particular process id: ps -o rss= -p PROCESS_ID

Achievements
1 Karma
0 Total ProTip Views