Heap, Fulco, Jenin discussed on Software Engineering Daily


With a new optimizing compiler building at the same time and simplified the whole pipeline. And so we. We ended up having a big project to sweep cold ignition and turbofan which was replacing completely the old compilation pipeline ambush was Fulco. Jenin crankshaft replacing it with ignition. And Turbofan where ignitions. The bike could interpreter internal finds the two compiler and so after that. And we've been working on various compilation toys. Asians here in London and the light project. All right let's talk a bit about memory management because that directly corresponds to the work you did on V8 light. How much memory does chrome us on a machine? I think it depends very much on April. Your machine is and be what type of user you are. There are a lot of tickly users who have maybe hundreds of of tabs open all the time. I'm one of them and in these situations crumbs. GonNa take a lot of your system memory in fact most of the time all my applications are sitting in. Chrome. They're running javascript. Applications in atop. So it's not really surprising the crumbs taking all that memory on desktop Where becomes a problem is on these low end phones where you really have much less memory? And so things were thinking about here or maybe have five hundred twelve megabytes of Ram which might sewn reasonable. But then you have to remember. The the hardware takes hundred megabytes. The operating system takes a hundred megabytes other applications. Two hundred megabytes really at the end of the day chrome ends up having a hundred megabytes of memory left to do all of this operation. So that's like rendering pictures laying the page and doing javascript tastes kitchen and saint. Time so depends where you're sitting on a mobile device. A typical web page really expect. Maybe thirty forty megabytes in the render a process. And which is the process this displaying the tab and all of that may be forty to sixty percent would be the VHS critique so as visa quite sizeable portion of that Moore usage general. How does the runtime for chrome on desktop compared to chrome on mobile and in terms of memory footprint so that we have done a lot more to is Asian work on how to fit the General Casey's to compress the General Casey's so the memory usage is generally lower those other aspects as well on mobile? You generally are viewing one tap and the operating system behind the scenes so in chrome each tab is a separate operating system process and on android operating system can kill processes when at rolling lawn. Memory I know do that. With interacting with the main croom process took away. That sounds like a problem. It can be a problem. Yeah and in some senses is kind of useful for us because we can create tabs on an leave it to the operating system. We give some hints as to which tabs are important and might switch back to. We can leave it to the operating system can of garbage light those types and as they go on so that typically scales much more widely depending on the foot. And so if you have a high end gigabyte ram device school and then you'll probably find a few switch between your last for five. Maybe ten taps. They're all still there. Whereas if you have a lower end one gigabyte Fulton switched to a couple of tops. Back in you see the whole time reloading. And that's because the process has been killed in the background in chrome needs to reload the webpage so the memory usage learn in software engineering school or computer. Science school consists of the stack and the HEAP IS V. Eight mostly or the chrome browser. Is it mostly consuming stack or heap is mostly heap and when we talk about heat we have slightly? We have probably more categorisations than just staff can heat. So there's definitely some slight memory m that's generally kept relatively small But depends we spin up love threats than each threat needs to have a stack so that might take some memory and then there's heap at NBA. We kind of partitioning between what we call. Maybe native heap which is your kind of typical C. Plus plus heat which you would allocate with Malik or new managed. That memory yourself as you're coding and then what we would call the managed. Heap. Which is the garbage collected javascript heap and we're all javascript objects live on. That has a very different field. Because the garbage collectors in charge of collecting memory and freeing the memory S. goes and typically. That's the largest part of memory for us and envy eight and is one of the more substantial memory in chrome overall as well tell me about some of the objects that might make up the heap. If I'm browsing typical website where I've got a website open. I'm on Hacker News Dot Com. And I've got three or four other chrome tabs open. What is in my heap on? Chrome lots and lots of things and so. I'll start with the things that are in. Va Lennon talk about some other things that are in chrome overall so on VHS managed heap the garbage to you'll have all your javascript objects so for example any functions stuff skirt functions. That were being compelled by code. That will live in the managed heap. We also have. Meta data which is where. Va actually came in. Where we keep track oth those functions look like Type of objects. Those functions have seen in those types of things. I and use that to optimize the code later. And then you have your actual objects so if you create arrays or strings or things like that in javascript than that whole also lives on the end the managed heap. You then have what's called the Dome an which lives eyesight of this is in the the ranger engine and blink. That's called the document. Object model and so if you know your html than that. You're you're kind of elephants. So maybe you're developments in your image elements and things like that and they're represented in a dome which is also garbage collected by a separate garbage collector in crew called oil pan. And then you have lots and lots of other things so you'll have your images on your site and they will be in both. The can of compressed form the J. pig farm but we also need to decompress a tissue on the screen so the decompress farms as well. They'll be the html source for the actue pitch came in. Css older objects are needed to process that. And then of course chrome needs to display the stuff on the screen so I think a large part of the memory ends up being the the GP command buffer so that commands the chrome sending to the GP to drop things onto the screen. Veteran.

Coming up next