A
alfonsobaldaserra
hello list
i am writing a script to check memory usage on linux.
the script opens and closes /proc/meminfo 5 times in 5 seconds to
calculate memory usage on 5 seconds average, it goes something like
for (1..5) {
open MEM, "/proc/meminfo" or die "..."
while (<MEM>) {
...
}
close MEM;
sleep 1;
}
i was just wondering if this is advisable to open/close file that
fast? is there any better approach to do this?
looking for your valuable suggestions.
thank you.
i am writing a script to check memory usage on linux.
the script opens and closes /proc/meminfo 5 times in 5 seconds to
calculate memory usage on 5 seconds average, it goes something like
for (1..5) {
open MEM, "/proc/meminfo" or die "..."
while (<MEM>) {
...
}
close MEM;
sleep 1;
}
i was just wondering if this is advisable to open/close file that
fast? is there any better approach to do this?
looking for your valuable suggestions.
thank you.