Here is a Windows batch file that records the top 10 highest memory using processes to a log file. Run it from the task scheduler every 15 minutes.
Be sure to edit this bat file to match your environment.
@echo off
REM schedule this to run in your task scheduler as frequently as you need it (say every 15 minutes)
REM do not run from etc\schedule.*.cfg as this logic does not work with the sort command provided with ProTop
REM this is just an example, your mileage may vary
set LOGDIR=c:\protop\log
set logfile=%LOGDIR%\mem_usage.log
echo. >> %logfile%
echo Logging process memory usage at %date% %time% >> %logfile%
echo ============================================================================== >> %logfile%
echo. >> %logfile%
echo Process List (Top 10 sorted by Memory Usage in KB, descending): >> %logfile%
echo. >> %logfile%
echo Image Name PID Session Name Session# Mem Usage >> %logfile%
echo ========================= ======== ================ =========== ============ >> %logfile%
:: Capture the list of all processes with PID and memory usage, sort by memory usage in descending order
tasklist /fo table /nh | sort /R /+64 | findstr/n ^^|findstr "^[1-9]: ^1[0]:" >> %logfile%
:: Add spacing for readability
echo. >> %logfile%
echo ============================================================================== >> %logfile%
echo. >> %logfile%
Here is the Linux version: How to find processes using the most memory