For a caching library, I need to know the runtime usage of memory of the  program and the total amount of memory, the total memory used by all the programs etc.<div><br></div><div> I need not do profiling or monitoring but to do different things inside my program depending on memory usage.</div>

<div><br>The search is difficult because all searches go to profiling utilities which I donīt need.<br><div><br></div><div>Are there some  portable way to to this? . The various monitoring libraries indicates that there are ways to do it, but they seem not to allow  runtime &quot;internal automonitoring&quot;</div>

</div>