Calculating Windows memory "in use" with logman help

I'm trying to write a Perl script that monitors the use of system RAM over time and writes it to a file. I'm trying to accomplish this by using logman counters, but unfortunately I can not find any logman counter that collects data for the "in use" memory as it is displayed in the task manager. Any help is appreciated.