On Tue, Jan 13, 2009 at 3:42 PM, mabshoff
<michael.absh...@mathematik.uni-dortmund.de> wrote:
>
>
>
> On Jan 13, 3:05 pm, Jason Grout <jason-s...@creativetrax.com> wrote:
>> mabshoff wrote:
>
> <SNIP>
>
>> > This is not how this works, i.e. a lot of the memory Sage uses is
>> > shared mappings between libraries, so the first notebook process is
>> > much, much more expensive than subsequent ones. top and the default
>> > interface it uses on Linux is dumb regarding shared mappings, i.e.
>> > every notebook process is reported to use every library that is
>> > dlopened by Sage.
>>
>> Okay, I was using top to calculate this.  What is a better way to
>> calculate the actual memory being used?  I'd like to have an accurate
>> idea of the memory requirements of a big Sage server.
>
> smap and pmap comes to mind. Some pointers to get started:
>
>  * 
> http://virtualthreads.blogspot.com/2006/02/understanding-memory-usage-on-linux.html
>  * http://bmaurer.blogspot.com/2006/03/memory-usage-with-smaps.html
>
> The slashdot discussion at
>
>  * http://it.slashdot.org/article.pl?sid=06/02/06/120210
>
> also has some lively discussion, but the signal to noise ratio is
> pretty bad or normal for slashdot :)
>
> Note that smap has Python binding for Linux, so we might want to
> consider using that optionally since not every kernel supports it,
> even though on modern system I would guess it will be hard to find one
> that doesn't.
>
> In general we are using crappy interfaces to measure memory
> consumption from Sage, i.e. get_memory_usage(). We are even parsing
> the output from "top" on non-Linux platforms!

Sage uses /proc/pid/status on Linux.  I don't know if this is "crappy"
or not; it's code that I got from
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/286222
Python Cookbook, by Jean Brouwers

On OSX, indeed it just naively reads top, which is... well just as
good or bad as top at reporting a valid number.  I don't know whether
OS X top is sensible or not, though I don't see why it would be wrong.

William

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to