I have written a script which assigns virtual or "simulated" memory to a process that I have created. What I want to know is, how can I then list how much memory the process has? I want it to return "process has x mbs" if I have assigned some memory or "process has currently no assigned memory" if I haven't assigned any memory.
How can I do this? I have included snippets of the code as it is too long to do so for pasting in here.
1)
read -p "Enter Memory Value [MB]" p
$script/simulate assignmem oxygen $p
sleep 5
;;
function assign_mem()
{
stop_kill $1
ulimit -m $2
"$script_folder"/"$1">/dev/null&
echo "Process $1 Assigned $2MB Memory"
}