porting an app that checks /proc/meminfo

Fernan Aguero fernan at iib.unsam.edu.ar
Fri Jan 27 05:38:51 PST 2006


+----[ Ulrich Spoerlein <q at galgenberg.net> (27.Jan.2006 07:53):
|
| Fernan Aguero wrote:
| > How does one gets the values of
| > i) memory used by the program/process and
| 
| As others have already told you: getrusage(2)
| 
| > ii) amount of RAM available in the computer without using
| > /proc/meminfo in FreeBSD?
| 
| What for? It is a rather useless value anyway. Either your malloc(3)
| calls succeed or not. If they do depends not only on RAM, but on the VM,
| Swap, and limits(1) (please correct me, if I'm wrong).
| 
| So the question is, what's the value used for in his program?
| 
| Ulrich Spoerlein
|
+----]

Ulrich,

I'm not the author, and I'm not particularly well
versed in C (or in any other language that has to manage low
level resources such as memory ... I'm basically a Perl/Shell guy :)

But I do have some idea of what muscle is trying to do, as
it is similar to other programs that implement similar
algorithms. And the problem is that the input data size (DNA
and/or protein sequences) is not known beforehand and can
vary greatly both in the number of sequences (strings) and
in the length of these sequences. 

So I suppose (but I'm not positive on this) that muscle is
making decisions based on the size of the dataset it has
been given, and it needs to have some idea of the available
memory. Perhaps it will follow different strategies ...  use
different data structures ... 

Fernan


More information about the freebsd-ports mailing list