On Wed, Apr 08, 2009 at 01:55:23PM -0700, Dan Price wrote:
> 568 + psinfo_arr = file("/proc/%d/psinfo" %
> os.getpid()).read(232)
>
> Use /proc/self/psinfo for simplicity.
Ah, good suggestion.
> What happens if we ever uyse 64-bit python? How brittle is this
> going to be?
If anything goes wrong, it'll simply give up on the memory calculation. I
just confirmed that on 64-bit python, we get a struct.error exception,
which is caught by the exception handler.
> When we discussed this, I think I suggested either:
>
> - Call sbrk(0)
> - Write a native routine which does the /proc stuff.
You did, and I responded that I really didn't want to write C code for
this, at least not for this release. I can rip out the memory gathering
entirely for now, until I or someone else writes the code.
sbrk(0) doesn't appear to be documented in the man page; should it be?
> Please scale the amount of memory into something other than bytes,
> and also indicate the units. A written this will say:
>
> At least 2343451 of virtual memory was in use by ...
Everyone seemed to miss the call to bytes_to_str(), which does all that for
you ... However, I'd forgotten it said "341.32 MB", which is silly, so
I've added a format argument to bytes_to_str() so that it'll print out
"341MB" for us (in the next webrev).
Thanks,
Danek
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss