[Python-es] Tamaño de un proceso en python

Jesus Cea jcea en argo.es
Jue Ene 31 13:48:47 CET 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Estoy interesado en que un script pueda medir "aproximadamente" su
ocupación de memoria. La medida no necesita ser exacta ni rápida, pero
debe ser portable (no me vale mirar dentro de "/proc" en Linux/Solaris,
o ejecutar un "ps" y buscarme en él porque eso no funciona en Windows).

El módulo "resource" sería perfecto si funcionase, pero bajo Linux
2.4.*, 2.6.* (versión antigua, al menos) y Solaris 10, el tamaño de
memoria siempre es "cero". De hecho en Solaris está documentado:

"""
$ man getrusage
[...]
~     The ru_maxrss, ru_ixrss, ru_idrss, and ru_isrss  members  of
~     the rusage structure are set to 0 in this implementation.
[...]
"""

Más claro, imposible.

¿Alguna idea?.

- --
Jesus Cea Avion                         _/_/      _/_/_/        _/_/_/
jcea en argo.es http://www.argo.es/~jcea/ _/_/    _/_/  _/_/    _/_/  _/_/
jabber / xmpp:jcea en jabber.org         _/_/    _/_/          _/_/_/_/_/
~                               _/_/  _/_/    _/_/          _/_/  _/_/
"Things are not so easy"      _/_/  _/_/    _/_/  _/_/    _/_/  _/_/
"My name is Dump, Core Dump"   _/_/_/        _/_/_/      _/_/  _/_/
"El amor es poner tu felicidad en la felicidad de otro" - Leibniz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQCVAwUBR6HDr5lgi5GaxT1NAQK2gQP+LpE9a3ZN0qrxpedxhXh74UK3FvDewDaD
sk3cyTD++HFTr8d/b3Tj8I6TwLIzdbSselhL5NhbesgYObAgPA6AnHyy+CX1N1l8
A8J/xhbrZQVhAytjDDsp9oAhvcbz2YYJBdRNbpK91QfZyg31OvMn5cFOX2WlFCnH
cgwRqDjTkoI=
=lRBI
-----END PGP SIGNATURE-----


Más información sobre la lista de distribución Python-es