7 ms·
Effectively Managing Memory at Gmail Scale
- Aloisius 12y agoIt is rather odd to think about "scaling" to a single computer, isn't it? This is more bloat management than scaling.
- adwf 12y agoI was thinking much the same - the Gmail backend surely has scaling issues, but the frontend should be relatively simple. Afterall, you can still use the basic html view if you want, the ajax view is just some icing on the cake; it can't be that resource hungry unless there are bugs.
- robin_reala 12y agoThere are always bugs in complex applications (especially when JS makes it this easy) and people leave their Gmail tab open for weeks: not an auspicious combination.
- adwf 12y agoOh yes, I wasn't trying to criticize that. Every sufficiently large program will have bugs. It was just that the title implied this was a scaling issue, rather than a debugging issue.
- bla2 12y agoMaybe scaling as in "scaling a team"? But yeah, it sounds weird.
- chrisrhoden 12y agoIt seems to me that they're referring more to the size of the application. "GMail Scale" implies highly-interactive single page web applications with a lot of functionality, to me.
- _almosnow 12y ago>While JavaScript employs garbage collection for automatic memory management, it is not a substitute for effective memory management in applications. And then they continue to make use of the Javascript's GC in order to do effective memory management... at gmail scale...
- asveikau 12y agoIt's "no substitute". I read that as: it doesn't free you from thinking about memory. GC or not, you still need to care about it.
- rokhayakebe 12y agoGmail still slow. Unrelated: Why haven't Google implemented a Google.com-quality-level search for email?
- napoleond 12y agoGmail's email search is already the best in the space, by far. I'm sure there are improvements to be made, but zero external pressure to make them.
- lostlogin 12y agoGmail looks particularly good after 5 mins using Apple's search in iClouds Mail.
- trjordan 12y agoThe new Inbox has "Top Hits", which is a more relevance-based search for email. It seems to work quite nicely, for me. I like that it gives you a couple highly-relevant emails, and the rest are still time-sorted for combing through all results.
- ColinCera 12y agoI believe they're attacking the challenge from the opposite direction: Gmail search can be described as "okay" and Google works tirelessly to make the main Google.com search experience worse and worse -- eventually they will succeed in degrading it from its former excellence to a point where its quality matches Gmail's.
- snowwrestler 12y agoI find Gmail search to work pretty well for me. The question I have is why the Google Voice iPhone app does not have a search function AT ALL.
- kissickas 12y agoI believe they're phasing out the Google Voice apps (although this may not have ever been announced) in favor of more integrated solutions. Now why Hangouts are not searchable, I will never know. I could care a bit less about the colors and animation strategy Google is using, but why they don't just put a search bar at the top of every product of theirs is a mystery I'm afraid I'll have to live with for quite some time. Even the Google+ app (at least) has terrible search and takes too many clicks - I believe Facebook has actually caught up on this.
- aikah 12y agoI always found onedrive services to be faster than google drive(the pdf viewer for instance).It seems that,recently,Gdrive downgraded their default pdf viewer,while proposing third party alternatives(which is an interesting system,I'm in the process of developping a good epub viewer for gdrive). Afaik,what MS does is,as much as possible,do things server side instead of client side.For instance,online excel calculations are done server side then the resulting cells are just HTML fragments sent to the ajax callback. It makes client apps consume way less memory,since less data is stored on the client. I have a crappy Android phone (2.x) and onedrive html app doesnt feel slow on it.On the other hand,I just cant use gmail(ajax versions) or google drive html apps.They are just not responsive.
- TheLoneWolfling 12y ago> Game developers, take note: to ensure a 16ms frame time (required to achieve 60 frames per second), your application must make zero allocations, because a single young generation collection will eat up most of the frame time. And this is why GC isn't the be-all and end-all solution to memory management. (As as for people that are screaming "pauseless GC" - it has throughput issues [generally due to fine grained locking / other synchronization], and also often has a performance hit on your main thread [due to locking or read barriers, generally]) Now, if someone combined a pauseless GC with proper cleanup (i.e. skipping GC altogether) of variables where the compiler could determine when they can be thrown away, matters would be different. (So, in other words, the compiler inserts `malloc` (or whatever) calls, and ensures that every variable created is either `free`d exactly once after it becomes unreachable or is added to the set tracked by the GC (or is a constant - especially pertinent with strings). With (hidden) local variables to track control flow when different branches cause different allocations.)
- potench 12y agoI'm not sure I understand how to make zero allocations? Does this mean you create your variables outside of a requestAnimationFrame (rAF) and update their values inside the rAF?
- TheLoneWolfling 12y agoThat's what it means, yep. Making object pools, etc. This can be harder than it sounds, to put it mildly. In other words, completely subverting the GC altogether.
- angersock 12y agoObject pools for vectors are damned useful...both Xith3D and Ardor3D in Java had free pools for their vector classes, and using those significantly impacted memory usage and frame delays.
- aikah 12y agoSo basically one needs to re-implement smart pointers in Javascript, right ? What are the alternative to js style GC,for a language that wouldnt want to the developper to use manual memory allocation.I've heard about ARC.Are there other known architectures?
- mccr8 12y agoThis is a cool article (from last year, FWIW). In particular, I like how Google uses Chrome browser improvements (the performance.memory API) to fix bugs in Gmail, and then in turn are able to reflect this back to use Gmail to notice bugs in Chrome. This sort of vertical integration that Google is able to do is really powerful (they were also able to take advantage of this to drive the development of SPDY), but a little concerning for anybody that has a browser but not a popular website, or vice versa. Although in this particular case, I don't think anybody else implements performance.memory, so there would be no easy way for Gmail to track memory usage in other browsers. Disclaimer: I work on Firefox and am speaking for myself, etc.
- TheAceOfHearts 12y agoDoes anyone else feel like Gmail has actually been getting slower in the past year? It feels like it takes a lot longer to load... And once it finally does load, you still end up having to wait a reasonable amount of time for Hangouts.
- thisjepisje 12y agoThe old html version is still pretty quick https://mail.google.com/mail/u/0/h/ https://mail.google.com/mail/u/0/h/
- nodata 12y agoGoogle Contacts. So slow it hurts.
- jimktrains2 12y agoI've felt that all of Google's services have been getting slower and less user-friendly over the past 5 or 6 years.
- frik 12y agoGMail always had a memory leak problem. Back in the early days of GMail (2004-2005), Internet Explorer 6 "trident" JS engine leaked memory like crazy. Manual garbage collection was always needed.
- corysama 12y ago> Anecdotes of Gmail tabs consuming multiple gigabytes of memory on resource-constrained laptops and desktops were being heard increasingly frequently You know, I think I recall being able to run quite nicely featured GUI mail clients and IRC clients simultaneously on a Pentium 90 with 16 megs of RAM. And, I expect those clients had an order of magnitude less developer effort put into them compared to the GMail client-side code. Meanwhile, I'm quite confident that Gmail team is composed of very, very smart developers. So, what am I missing? Why does GMail require two orders of magnitude more resources?
- wtetzner 12y agoI don't think it normally does. I think what probably happens is that there are memory leaks. The longer you leave the tab open, the more memory it ends up consuming. There's also the fact that it runs in the browser, which can make it more difficult to control or understand how many resources will be used.
- tambourine_man 12y agoI often make this kind of argument as well, but the demands we put an email client through these days are nowhere near what such a machine could handle. I have around 80.000 messages in my inbox, most of them with attachments around 10MB, and I can browse and search them instantly. Then again, I mostly use Gmail's backend, my preferred interface is Mail.app