<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On 07.11.2010, at 22:08, Tabitha Roder wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="gmail_quote"><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote"><div> Re memory usage - we already go through the "please don't open too many activities" routine all the time <br>
</div></blockquote><div><br>How come my Android phone is okay with running everything at once?</div></div></blockquote><div><br></div><div>It doesn't. It just makes it look like it is.</div><br><blockquote type="cite"><div class="gmail_quote"><div> What does it do that means I don't run out of memory? Can we do that to Sugar? Apparently the phone is killing apps when it needs to but when you restart the application it picks up where it left off (I might be repeating something already discussed on this list?). <br></div></div></blockquote><br><div>Of course you are ;)</div><br></div><div>Sugar was intended to kill background activities if resources got low, too. But there never were enough engineering resources to make it work. There have been experiments with the OOM killer, but I think the only result was to acknowledge that It Is A Hard Problem.</div><div><br></div><div>Sugar is much closer to "regular" Linux than Android. This is intentional, we wanted to make "sugarizing" normal Linux applications easy, and even allow to run them directly (both to invite open-source developers and leverage existing code as possible). We were successful at that, there is indeed very little difference between an activity and any other X11 app (and we intend to make the difference even smaller).</div><div><br></div><div>So the upside is that a Sugar activity is almost like a regular Linux app. The downside is that a Sugar activity is almost like a regular Linux app. </div><div><br></div><div>Activities are supposed to save their complete state to the Journal. That would include which view is displayed, where the cursor is, etc. If they did that, then stopping and resuming an activity would be seamless. The user wouldn't even notice it happened.</div><div><br></div><div>But few Sugar activities do that. There are no general facilities to help the developer make it work. Also, there is little incentive to do it, since there is no automatic killing of activity. And one reason there is no killing is that starting an activity is just too slow. And when sugarizing an existing app it would be really hard because desktop applications are rarely designed for this.</div><div><br></div><div>Android had the luxury of starting with a pretty clean slate. Everything above the Linux kernel (and even inside it) was designed to make this work. There isn't even the concept of the whole app staying in RAM, it is only a small part that stays resident when switching away. Saving the state of that part is comparatively simple.</div><div><br></div><div><div>I don't see how Sugar could do something similar without a complete redesign.</div></div><div><br></div><div><blockquote type="cite"><div class="gmail_quote"><div>Back in the old days, Sugar showed you how many activities were running in the home view, that might have been more obvious to kids that they were overloading their laptops. <br>Would it be possible to have a message pop up that says "you are running out of memory, which activity would you like to close" or similar so they are alerted to running too much stuff. <br></div></div></blockquote></div><div><div class="gmail_quote"><div><br></div><div>Well, asking the user is always the cheap way out, but we might not have the resources to do better.</div></div></div><div><br></div><div>
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Lucida Grande; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="font-family: Helvetica; "><span class="Apple-style-span" style="font-family: Helvetica; ">- Bert -</span></div></span></div><div><br class="webkit-block-placeholder"></div><div>PS: Overall it's amazing how much Sugar "got right" on its own though. Fullscreen apps, automatic saving/resume, sandbox security, app bundles, these are all features Sugar shares with Android and iOS. But when Sugar development started in 2006 (*) these were not around yet. There was no obvious software to use as a base with these features. The Android "preview" SDK was released in Nov. 2007 but there was no hardware yet, the iPhone SDK was released in March 2008. Still, when OLPC started mass-producing the XO-1 in 2007 there were third-party Sugar activities already.</div><div><br></div><div>(*) <a href="http://dev.laptop.org/git/sugar/commit/?id=2cc103db83ed1550e2a9e92bf3306e4476c1297a">http://dev.laptop.org/git/sugar/commit/?id=2cc103db83ed1550e2a9e92bf3306e4476c1297a</a></div></body></html>