Single C/C++ header only that supports reducing process RAM usage.
- Windows x86 & x64
- Linux
#include "opr.h"
int processId = 1024; // -1 for current process
int ret = opr_Clean(processId);
printf("process [%d]: %s\n",
processId,
ret == 1 ? "ok" : (ret == -1 ? "cannot access or does not exist" : "fail")
);
- Create a new C source and add:
#include "opr.h"
(add DllMain if necessary) - Build as dynamic library/DLL with preprocessor:
OPR_EXPORTS
orBUILD_DLL
$ gcc -w -shared -O2 -o opr.dll -DBUILD_DLL src.c -lpsapi