getMemorySize=function(exefile){//读取进程中程序使用内存大小
    import process
      
    GetProcessMemoryInfo = ::Psapi.api("GetProcessMemoryInfo","int(pointer hProcess,struct& ppsmemCounters,int cb)")
      
    PROCESS_MEMORY_COUNTERS= class{
        int cb;
        int PageFaultCount;
        int PeakWorkingSetSize; //物理内存的最大值
        int WorkingSetSize;     //物理内存的大小
        int QuotaPeakPagedPoolUsage;
        int QuotaPagedPoolUsage;
        int QuotaPeakNonPagedPoolUsage;
        int QuotaNonPagedPoolUsage;
        int PagefileUsage;      //虚拟内存大小
        int PeakPagefileUsage;  //虚拟内存的最大值
    }
      
    mem=PROCESS_MEMORY_COUNTERS()
    for processEntry in process.each(exefile) { 
        prc=process(processEntry.th32ProcessID)
       try{
            GetProcessMemoryInfo(prc.handle,mem,raw.sizeof(mem))
            io.print(processEntry.szExeFile + " 内存使用:",mem.WorkingSetSize/1024 ++ "K")
        }
    }
      
}
io.open()
getMemorySize(".*.exe")