On Jan 13, 2009, at 6:04 PM, mabshoff wrote:
> On Jan 13, 5:50 pm, Jason Grout <jason-s...@creativetrax.com> wrote: >> Jason Grout wrote: > > <SNIP> > >>> I noticed that for my Sage server, each open worksheet took about >>> 140MB >>> of RAM. When I ran out of memory, the server froze and lots of >>> errors >>> happened. To me, it sounds like you probably ran out of memory >>> if you >>> had 15 worksheets open simultaneously (which I would calculate would >>> need about 15*140=2100 MB of RAM). >> >> I should retract this statement. I just measured it again and found >> that it took about 40MB per worksheet process. To measure this, I >> started the sage server, created a new worksheet, and ran "1+1". >> I then >> looked at the free memory reported at the top of top. Then I created >> another new worksheet and ran "1+1", and checked the free memory >> again. >> The free memory went down by about 45MB. Michael Abshoff says that >> that numbers sounds about right. I don't know if I measured >> inaccurately before or if I just misremembered the number. At any >> rate, >> with that number, it seems that 15 simultaneous worksheets would >> use a >> minimum of 15*45=675MB, which is still more than you allocated. >> And as >> others point out, this is before the OS, the sage server, etc. > > Note that a lot of that 45 MBs is a bunch of strings due to the online > help, i.e. if you look at the python heap while running Sage you will > discover that about 12 MB or so of that is the "online" help. > > Another thing worth thinking about is forking the various Sage > notebook processes off a master process instead of starting new a new > python process for each one. That way on Linux for example with COW a > lot of the data and also code would be shared by all running > processes. forking either a fully working Sage session or at least > everything but twisted would certainly be a killer feature to > implement since it would allow much quicker worksheet startup as well > as insanely fast doctesting since we can skip the startup time of Sage > for each file. Gary Furnish has looked into doing this, but I am not > sure how far he got. > > But maybe we want to take that discussion over to [sage-devel] since > we are getting far, far away form the original problem :) +1, that sounds like a very good idea. I'd imagine one could have a fresh copy of sage, and just fork from there for every new doctest/ notebook session. (It would probably be a lot simpler, and still scale much better, for the notebook to start an unused sage process in the background and then repeatedly forking that rather than trying to fork the notebook process itself). - Robert --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---