Chrome Beta for Android Update

Hi everyone! We've just released Chrome Beta 107 (107.0.5304.91) for Android. It's now available on Google Play.

You can see a partial list of the changes in the Git log. For details on new features, check out the Chromium blog, and for details on web platform updates, check here.

If you find a new issue, please let us know by filing a bug.

Krishna Govind
Google Chrome

Chrome Beta for Android Update

Hi everyone! We've just released Chrome Beta 107 (107.0.5304.91) for Android. It's now available on Google Play.

You can see a partial list of the changes in the Git log. For details on new features, check out the Chromium blog, and for details on web platform updates, check here.

If you find a new issue, please let us know by filing a bug.

Krishna Govind
Google Chrome

How Googlers are building for everyone, with everyone

Over the past few weeks, I’ve been recharged by conversations with people from all walks of life: students participating in National Historically Black Colleges and Universities (HBCU) Week; policymakers at the Congressional Black Caucus Foundation and Congressional Hispanic Caucus Institute’s events; and community leaders and Googlers from around the world. There’s a shared sense of excitement, and urgency, about the future we’re helping to build. And after years of virtual gatherings, many in-person events have had the invigorating feel of family reunions.

A symposium with Black executives and the annual Hispanic Heritage Awards in September were energizing, too. At the award ceremony honoring the leadership and accomplishments of the Latino community, we announced a foundational donation from Google.org to the Smithsonian National Museum of the American Latino, which will center Latino stories as part of the American narrative.

As a result of our ongoing equity efforts, we were recently recognized at the Business Travel Awards in Europe for our Accessibility Travel Desk. Through this program, business travel agents offer specialized pre-trip and on-trip planning services to Googlers with disabilities so they have what they need on the road. For our U.S. employees, we also recently introduced Health+ Communities, which aims to provide personalized care focused on addressing the particular needs of groups historically underserved in medical care, such as the LGBTQ+ community.

There is always more to do to build toward sustainable equity. Here, four Googlers talk about other work in progress.

Making onboarding easier

Catalyzing change for startups

Driving toward Africa’s digital transformation

Connecting communities

Why Google supports the US Securing Open Source Software Act

Open source software — code that is made freely available to the public to use or modify — is the foundation of the modern internet. It’s given us a world that is more innovative and more accessible. Yet the very openness that makes the digital world accessible to everyone, also leaves it uniquely vulnerable to security threats and cyber attacks.

At Google, we’ve been working to solve this paradox for years — and have arrived at the conclusion that modern digital security actually can come through embracing openness. We protect more people online than anyone, and we recently announced a $10 billion investment in making the internet safer and more secure. But with the dramatic rise of state-sponsored cyber attacks and malicious actors online, it’s clear that we not only need stronger public-private partnerships — but dynamic policy frameworks to shore up security for everyone.

That’s why we welcome efforts by the U.S. Government to advance open source software security, such as the Securing Open Source Software Act introduced in the Senate last month. This bipartisan bill proposes the creation of a framework to guide the federal government in their use of open source software. The proposed legislation reflects a helpful focus on security and cyber risk mitigation to respond to a recent spike in malicious cyber activity against the software supply chain.

We are glad to see a continued emphasis on the importance of open source software security from the U.S. Government, and we hope that both public and private organizations will follow their lead to promote improved cybersecurity for the ecosystem at large.

The problem of securing open source

The world of open source software development allows collaboration and rapid innovation by sharing solutions freely. This community, built on openness and sharing, contributes an enormous amount of code to a majority of the applications we use today.

However, despite the benefits of this openness, the unprecedented scale of recent attacks has emphasized gaps in infrastructure and tooling and the need for improved transparency into the security practices and attributes of open source projects. Seemingly simple questions about the open source supply chain are still difficult to answer:

  • Does a project contain known vulnerabilities?
  • Are the project’s maintainers and community following security best practices during software development?
  • What open source dependencies are part of a particular piece of software?
  • How secure was the distribution supply chain?

Answering these questions requires specialized technical skills and capabilities, and given the primarily volunteer-driven nature of the open source community, we cannot expect open source developers to shoulder the full burden of advancing software security on their own.

Continued advances

Through our work with multiple industry collaborators, Google has helped create free tools, services and best practices to make it easier for the open source community to develop and distribute software securely, while providing consumers with information about the security of the software they use.

We envision a more secure future where the burden of security is shared, and there is increased trust in and resilience of the open source software ecosystem. To get there, we need freely available, automated solutions that make developer’s lives easier, such as:

  • Infrastructure that prevents tampering, by default, when software is being built and released
  • Advances in vulnerability discovery and management that automate finding, tracking and fixing bugs for developers
  • Seamless connections across sources of security data and tools for analysis so consumers can have meaningful insight into the security of their software

We’re currently working to make these solutions a reality, at scale, with little to no additional work for developers.

Sustaining the community

We hope that the framework that will emerge due to U.S. Government efforts drives further investments in open source communities by both the public and private sectors. We’re already seeing the impact of the $100M Google pledged to non-profit organizations and software foundations like the Open Source Security Foundation to support open source creators.

This pledge backs efforts like our “open source maintenance crew,” a team of developers who spend 100 percent of their time directly enabling critical open source projects to adopt key security improvements. It also supports our Linux Kernel team, which continues to drive efforts to eliminate entire classes of bugs from open source code, including paving the way for greater memory safety using the Rust language.

We encourage other major consumers of open source to follow this lead and directly invest both funds and developer time in securing open source projects and ecosystems. Furthermore, we call on other major consumers of open source, both public and private, to implement similar policies around safe open source usage as well.

Securing open source software is a shared responsibility, and we look forward to continued collaboration on this urgent, critical problem.

Improving accessibility led this UX researcher to Google

Welcome to the latest edition of “My Path to Google,” where we talk to Googlers, interns and alumni about how they got to Google, what their roles are like and even some tips on how to prepare for interviews.

Today’s post is all about Jerry Robinson, a user experience (UX) researcher on our Central Product Inclusion, Equity and Accessibility team.

What’s your role at Google?

I’m the lead UX researcher on the Lookout team. Lookout is an Android app that uses AI to help people who are blind or have low vision perform daily tasks faster. It can read text and detect different objects within the camera’s field of view. One of my favorite features is the food label mode, which can quickly identify food products — like whether you’re holding a can of chicken or tomato soup.

I conduct research with current and potential Lookout users to find opportunities to make the app more useful. I love this part of my job because I get to hear directly from the people using our products and share what I’ve learned with my teammates. It’s a privilege to be in a role where I can help our product teams better understand our users and carry out Google’s mission to make information universally accessible.

Jerry stands outside next to a sign with the Google logo.

Can you tell us a bit about yourself?

I graduated from Morehouse College in 2004 with a degree in accounting. After working in the banking industry for five years, I decided to go to grad school and find a career where I could make an impact on people’s everyday lives. Also, as someone with a disability living in a world not always designed with them in mind, I was interested in accessibility and ways to support people with disabilities on their terms.

I earned a Master of Science in Information Management and a PhD in Information Science. My dissertation was focused on accessible design from the perspective of people with physical disabilities finding their own ways to adapt to inaccessible situations in their everyday lives.

How did the application and interview process go for you?

I met a Googler at an assistive technology conference a few years earlier who told me about the open role. I expressed interest and connected with a recruiter, and eventually received a referral from another Googler.

My biggest concern during the interview process was communication. I have a distinct speech pattern because of my cerebral palsy, and I’ve always been concerned that potential employers might hold that against me. However, I knew that Google had an inclusive work environment. And I was confident in my ability to conduct good UX research.

The interview process actually assured me that I was a strong candidate. My interview committee asked tough questions, but they were extremely thoughtful and kind. One of them told me to think of the interview more as a conversation, while another complimented me on my presentation. I felt a level of respect from the very beginning that put me at ease and made me more certain that I wanted to work here.

Jerry smiles and sits in a Google micro-kitchen.

Jerry in a Google office micro-kitchen.

What inspires you to come in (or log on) every day?

I’m inspired by all the Google UXers I work with who are passionate about designing for everyone. Google, and the tech industry overall, needs people who are dedicated to making accessible design the norm rather than an afterthought.

What resources did you use to prepare for your interview?

My recruiter was incredibly helpful. He gave me tips about what to communicate during each interview round, including how best to present the scope, complexity and impact of my work. I practiced my final presentation several times before my last round of interviews to build up my confidence. And I went to bed early the night before to make sure I felt rested.

Any tips to share with aspiring Googlers?

Do all that you can to prepare, but also be confident in what you bring to the table. Know that you’re going through the process because you’re already a qualified candidate. Remind yourself that as often as you need to.

Democratizing access to health

Editor’s note: This essay originally appeared in The Global Governance Project's magazine, as part of Google's wider participation in the World Health Summit. Dr. Garth Graham, the global head of YouTube Health, also contributed a piece on the role of information as a determinant of health.

The COVID-19 pandemic energized public-private partnerships and strengthened the role of technology towards democratizing access to health to help billions of people everywhere live healthier lives — but fresh challenges are emerging from its shadow

COVID-19 has been a generation-defining challenge filled with incalculable human costs and long-term impacts that remain unclear. Like many, I have been reflecting on how the pandemic will shape medicine and public health in particular for generations to come.

The pandemic severely tested public health. Many places around the world could not keep pace with the demands of disease surveillance and continue to see challenges with vaccination rates. Still, public health rose to the occasion. Public health officials quickly interpreted evolving science to provide guidance that kept individuals and communities safe. There were also live-saving scientific advancements — from realizing the promise of mRNA vaccines and adaptive clinical trials to using real-world clinical data to inform regulatory processes.

Underlying some incredible gains were public-private partnerships — particularly between the technology and health sectors — which I believe will continue to flourish. These partnerships have made the wider dissemination of public health messages, better data and surveillance systems, and faster interventions possible.

For our part at Google, we adapted to accommodate this hopefully once-in-a-lifetime event by launching more than 200 new products, features and initiatives, in addition to providing in-kind donations totaling more than $1 billion.

Surfacing quality information is part of our core mission. During the first weeks of the pandemic, we recognized the opportunity to provide the right information, at the right time through the reach of platforms such as Search and YouTube that amplified health messages to billions of people, encouraging them to “flatten the curve” through non-pharmacologic interventions. We donated Google Search Advertising and offered assistance to organizations, such as the World Health Organization, to provide more than two billion COVID-related public service announcements that connected nearly 100 million people to high-quality information.

Issues masked by the pandemic

Today, as we conceive of a time when COVID-19 is endemic, we must turn our attention in earnest to other global challenges that the pandemic masked or even exacerbated. For our part, we will continue to use our products, technologies and expertise to help people, their caregivers and their communities, focusing on areas that align with the United Nations Sustainable Development Goals, such as mental health and maternal health.

During the first year of the pandemic, anxiety and depression increased by 25% across the globe.[aea966]Searches for “mental health therapist” and “mental health help” reached record highs in the U.S. in 2022.[3def86]To make it easier to access mental health services and resources — such as clinically validated mental health self-assessments and crisis hotlines — we are enhancing information resources on Search and YouTube, partnering with organizations including the National Alliance on Mental Illness in the US, the Samaritans in the UK and iCall in India.

The pandemic also made it clear that existing healthcare gaps need to be filled so people can access the best care no matter where they are. At least half of the global population lacks essential health services[31a300], such as immunizations and pediatric care. Technology can help fill these capacity gaps — especially artificial intelligence. Already, AI has demonstrated promise not just as a tool to support significant gains in health care, but also as a means to eliminate disparities and improve health for everyone, everywhere. We are invested in the research and development of these technologies, and doing so inclusively and ethically.

For example, the global maternal mortality rate remains high, with an average of 152 deaths per 100,000 live births.[b27223]The vast majority of deaths occur in low- and lower-middle income countries. We are partnering with Northwestern Medicine to expand access to fetal ultrasound, validating the use of AI to create more automated and accurate evaluations of maternal and fetal health risks. The goal is to train providers and community health workers to conduct ultrasounds and assessments in the field.

Another area where AI can be helpful is cancer screening. Breast cancer is the most common form of cancer with 2.26 million new cases occurring each year, yet early screening and detection can improve long-term outcomes.[3e6ff6]We have been researching how AI can reduce the time to diagnosis and improve the patient experience.

The full picture

As we support health service providers across the globe, we are uncovering ways to make sure they have the information they need to care for patients. Today, healthcare workers use smartphone applications to manage data specific to certain diseases, for example malaria and tuberculosis. But that data is often stored across multiple applications and formats, making it hard to have a full picture of a patient’s needs. To provide access to advanced mobile digital health solutions, we are working with the WHO to build an open-source software development kit, or SDK.

We see these innovations as important steps on the road to democratizing health care. There are more on the horizon, fueled by AI and cloud computing, that can bring more meaning to the data and unlock innovation. A great example of this can be found in emerging efforts at the intersection of public health and climate change where we are beginning to see patterns and associations among climate, weather and health.

Technology is just one tool to solve these public health challenges and its effectiveness depends on robust public-private partnerships. When we look back at the COVID-19 pandemic and all of the related health crises it brought awareness to, I believe that we will recognize it as a moment that energized our ability to collaborate. And that spirit of collaboration and partnerships will transform public health and democratize its benefits for everyone, everywhere.

How Android protects you from scams and phishing attacks

Cybercriminals are targeting smartphones and tablets more than ever before. That’s because people are spending more time on their mobile devices, and they’re using them to send and store significant amounts of valuable data — like banking information, healthcare data and passwords. Cybercriminals are also targeting mobile devices because of their smaller screen sizes and frequent app and messaging notifications, which make it more difficult to verify if a sender is legitimate.

These criminals are increasingly using phishing attacks, scams and malware to obtain sensitive financial information or account passwords. In fact, during the pandemic, phishing attacks grew by 600% and became the top infection method in 2021.

Phishing attempts can come from a variety of sources like emails, text messages, voice calls and even third-party messaging apps. So it’s critical to have a layered security approach in place to defend from many angles. To help ensure we’re providing strong protection on Android, we hired a third-party security lab to evaluate our features and functionality that help protect you from scam and phishing attacks on your mobile devices. The report concluded that Android devices provide more features for scam and phishing protection than other mobile operating systems[15bb22].

For Cybersecurity Awareness Month, let’s take a closer look at these features and ways you can further protect your devices.

Avoid spam, scam and phishing attempts

Attackers often use text messages since they’re an easy channel to reach people. Messages by Google uses machine learning models to help proactively detect 1.5 billion spam, phishing and scam messages every month. It looks for known patterns and either diverts bad messages into the spam folder or warns you if it notices something suspicious.

A phone screen shows a “suspected spam” warning underneath a phone number, with the option to “report spam.”

Messages by Google detects 1.5 billion spam, phishing and scams messages every month.

Messages are analyzed with your privacy in mind, so they stay on your device and are never shared with anyone. You can, however, report a message to Google to help protect others. Gmail, the default email app on most Android phones, is also highly effective at flagging malicious messages, automatically blocking 99.9% of spam, phishing and malware.

Attackers today aren’t just using text messages and emails to phish for data. We’ve seen a 5x increase in the number of attacks involving phone calls, where a criminal tries to impersonate your bank or IT department to get you to hand over your credentials. Phone by Google provides multiple security defenses to help protect against attacks like these — from built-in caller ID and spam protection to Call Screen.

Get warned about bad links, downloads and apps

Many phishing and scam attempts try to get you to visit a malicious page impersonating a legitimate-looking site to enter your credentials, steal your social security number or download malware. Safe Browsing on Android protects 3 billion devices globally and helps warn you about potentially risky sites, downloads and extensions. It offers broad protection throughout your Android experience — from browsing on Chrome and other browsers to connecting to the web through social media apps

A red phone screen shows a warning for a website, which says “the site ahead contains malware.

Safe Browsing helps defend you from dangerous websites and malicious files whether you're on a browser or an app.

Even if you download an app outside of Google Play, Google Play Protect checks the installation and can warn you about a harmful or malicious app. Play Protect also scans all the apps on your device every day for harmful ones, even if you’re offline.

Get notified about your Google account

On Android phones running version 7.0 and up, you can use the built-in security key for additional protection. When you or someone else tries to sign into your Google account, you’ll get a notification on your phone asking to confirm that it’s you.

And it’s always good to regularly do a Security Checkup, which you can access right from your device settings. It’ll provide personalized security tips for your account, remind you to keep your passwords up to date, and share what devices you’re currently signed in on and what apps have access to your data.

Learn more about how you and your data are safer with Google on Android devices.

Source: Android


Interview with Doug Duhaime, contributor to Google’s Dev Library

Posted by the Google Dev Library Team

Introducing the Dev Library Contributor Spotlights - a blog series highlighting developers that are supporting the thriving development ecosystem by contributing their resources and tools to Google Dev Library.

We met with Doug Duhaime, Full Stack Developer in Yale University's Digital Humanities Lab, to discuss his passion for Machine Learning, his processes and what inspired him to release his PixPlot project as an Open Source.

What led you to explore the field of machine learning?

I was an English major in undergrad and in graduate school. I have a PhD in English literature. My dissertation was exploring copyright history and the ways that changes in copyright law affected the book market. How does the institution of fixed duration copyright influence the book market? To answer this question, I had to mine an enormous collection of data - half a million books, published before 1800 - to look at different patterns. That was one of the key projects that got me inspired to further explore the world of Machine Learning.

In fact, one of my projects - the PixPlot library - uses computer vision to analyze image collections, which was also partially used in my research. Part of my research looked at plagiarism detection and how readily people are inclined to copy images once it becomes legal to copy them from other texts. Computer vision helps us to answer these questions and identify key patterns.

I’ve seen machine learning and programming as a way to ask new questions in historical contexts. And there's a whole field of us - we're called digital humanists. Yale University, where I've been for the last five years, has a fantastic digital humanities program where researchers are asking questions like this and using fun machine learning platforms like TensorFlow to answer those questions.

Screenshot from the PixPlot library showing Image Fields in the Meserve-Kunhardt Collection with the following identified hotspots: Boxers, Buildings, Buttons, Chairs, Gowns

Can you tell us more about the evolution of your PixPlot library project?

We started in Yale's digital humanities lab with a project called neural neighbors. And the idea here was to find patterns in the Meserve-Kunhardt Collection of images.

Meserve-Kunhardt is a collection of photographs largely from the 19th century that Yale recently acquired. After being acquired by the university, some curators were preparing to identify all this really rich metadata to describe these images. However, they had a backlog, and they needed help to try to make sense of what's in this collection. And so, Neural Neighbors was our initial attempt to answer this question.

As this project went on, we started running up against limitations and asking bigger questions. For example, instead of just looking at the pictures, what would it be like to look at the entire collection all at once? In order to answer this question, we needed a more performant rendering layer.

So we decided to utilize TensorFlow, which allowed us to extract vector representation of each image. We then compressed the dimensionality of those vectors down to 2D. But for PixPlot, we decided to use a different dimensionality reduction technique called umap. And that brought us to the first release of PixPlot.

The idea here was to take the whole collection, shoot it down into 2D, and then let you move through it and look at the images in the collection wherein we expect images with similar content to be placed close by one another.

And so it's just evolved from that early genesis and Neural Neighbors through to where it is today.

What inspired you to release PixPlot as an open source project?

In the case of PixPlot, I was working for Yale University, and we had a goal to make as much of our contributions to the software world as possible open and publicly accessible without any commercial terms.

It was a huge privilege to spend time with the lab and build software that others found useful. I would say even more generally, in my personal life, I really like building things that people find useful and, when possible, contributing back to the open source world because, I think, so many of us learn from open source.

Google Dev Library Quote: We look at other people's examples and get excited by tools and projects others are building. And many of those are non-commercial. They're just open and free to the world. And it's great to give back when we can. Doug Duhaime Dev Library Contributor

Find out more content contributed and authored by Doug Duhaime and discover more unique tools and resources on the Google Dev Library website!

Optimize for Android (Go edition): Lessons from Google apps Part 3

Posted by Niharika Arora, Developer Relations Engineer

In Part 1 and Part 2 of our “Optimizing for Android Go” blog series, we discussed why we should consider building for Android Go and how to optimize your app to perform well on Go devices. In this blog, we will talk about the tools which helped Google optimize their Google apps performance.

Tools

Monitoring Memory

Analyze Memory Footprint 

 1.    To determine the memory footprint for an application, any of the following metrics may be used:
    • Resident Set Size (RSS): The number of shared and non-shared pages used by the app
    • Proportional Set Size (PSS): The number of non-shared pages used by the app and an even distribution of the shared pages (for example, if three processes are sharing 3MB, each process gets 1MB in PSS)
      • Note: Private Set Size (PSS) = Private memory + (shared memory / the number of processes sharing).
    • Unique Set Size (USS): The number of non-shared pages used by the app (shared pages are not included)

PSS is useful for the operating system when it wants to know how much memory is used by all processes since pages don’t get counted multiple times. PSS takes a long time to calculate because the system needs to determine which pages are shared and by how many processes. RSS doesn't distinguish between shared and non-shared pages (making it faster to calculate) and is better for tracking changes in memory allocation.

So, which method should you choose? The choice depends on the usage of shared memory.

For example, if the shared memory is being used by the application only then we should use the RSS approach. While, if the shared memory is taken by the Google Play Services then we should use the USS approach. For more understanding, please read here

2.    Take a heap dump and analyze how much memory is utilized by the running processes. Follow
    • Review the Prerequisites. 
      • Developer options Don't keep activities must be OFF. 
      • Use recent release builds for testing.
    • Execute the user journey you desire to measure.
    • Run the following command:
                    adb shell am dumpheap <You Android App Process ID> <output-file-name>
    • In a second terminal, run the following command and wait for message indicating that the “heap dump has completed”:
adb logcat | grep hprof
    • Run:
adb pull <output-file-name> 
 
This will pull the generated file to your machine for analysis.
 
To get info on native heap, read here :

To know about Java heap, read here :

3.    Understand low-memory killer

In Android, we have a process called low memory killer, and this will pick a process from the device and will kill that process when the device is under low RAM, the thresholds can be tuned by OEMs. By doing so, you will get back all the memory that the process was using.
But what if the low memory killer kills the process that the user cares about?
 
In Android, we have a priority list of applications and based on that priority list we remove the app when the low memory killer comes into play. Read more here.

You can run this command and know :
adb shell dumpsys activity oom

To check stats on low memory killer :
adb shell dumpsys activity lmk

For more information, please check Perfetto documentation for Memory.
 

Tools 

 1.    Debug Memory usage using Perfetto
This is one the best tools to find where all your app memory is consumed. Use Perfetto to get information about memory management events from the kernel. Deep dive and understand how to profile native and Java heap here
 
2.    Inspect your memory usage using Memory Profiler
The Memory Profiler is a component in the Android Profiler that helps you identify memory leaks and memory churn that can lead to stutter, freezes, and even app crashes. It shows a real time graph of your app's memory use and lets you capture a heap dump, force garbage collections, and track memory allocations. To learn more about inspecting performance, please check MAD skills videos here
 
3.    Utilize meminfo
You may want to observe how your app's memory is divided between different types of RAM allocation with the following adb command: 

adb shell dumpsys meminfo <package_name|pid> [-d]


You can view the following seven memory categories with Meminfo:
    • Java heap – memory allocated by Java code
    • Native heap – memory allocated by native code. These are best understood using debug malloc. Allocations made by the application from C or C++ code using malloc or new.
    • Code – memory used for Java, native code and some resources, including dex bytecode, shared libraries and fonts
    • Stack – memory used for both native and Java stacks. This usually has to do with how many threads your application is running.
    • Graphics – Memory used for graphics buffer queues to display pixels to the screen, GL surfaces and textures and such.
    • Private Other – uncategorized private memory
    • System – memory shared with the system or otherwise under the control of the system.

Key memory terms:

    • Private – Memory used only by the process.
    • Shared – System memory shared with other processes.
    • Clean – Memory-mapped pages that can be reclaimed when under memory pressure.
    • Dirty – Memory-mapped page modified by a process. These pages may be written to file/swap and then reclaimed when under memory pressure.

Note :

    • Debug class is super useful and provides different methods for Android applications, including tracing and allocation counts. You can read about usage here.
    • For deeper understanding and tracking allocations for each page, read about page owner here.
4.    Detailed analysis using showmap
The showmap command provides a much more detailed breakdown of memory than friendly meminfo. It lists the name and sizes of memory maps used by a process. This is a summary of the information available at /proc/<pid>/smaps, which is the primary source of information used in dumpsys meminfo, except for some graphics memory.
$adb root
$ adb shell pgrep <process>
Output - process id
$ adb shell showmap <process id>

Sample Output :

 virtual                     shared   shared  private  private

    size      RSS      PSS    clean    dirty    clean    dirty object

-------- -------- -------- -------- -------- -------- -------- ------------------------------

    3048      948      516      864        0       84        0 /data/app/……

    2484     2088     2088        0        0     2084        4 /data/app/……..

     144       72        2       68        4        0        0 /data/dalvik-cache/arm64/system@framework@<...>.art

     216      180        5      176        4        0        0 /data/dalvik-cache/arm64/system@framework@<...>.art

     168      164        8      136       24        0        4 /data/dalvik-cache/arm64/system@framework@<...>.art

      12        8        0        4        4        0        0 /data/dalvik-cache/arm64/system@framework@<...>.art

    1380     1300       73     1100      164        0       36 /data/dalvik-cache/arm64/system@framework@<...>.art

Common memory mappings are:

    • [anon:libc_malloc] - Allocations made from C/C++ code using malloc or new.
    • *boot*.art - The boot image. A Java heap that is pre-initialized by loading and running static initializers where possible for common frameworks classes.
    • /dev/ashmem/dalvik-main space N - The main Java heap.
    • /dev/ashmem/dalvik-zygote space - The main Java heap of the zygote before forking a child process. Also known as the zygote heap.
    • /dev/ashmem/dalvik-[free list ] large object space - Heap used for Java objects larger than ~12KB. This tends to be filled with bitmap pixel data and other large primitive arrays.
    • *.so - Executable code from shared native libraries loaded into memory.
    • *.{oat,dex,odex,vdex} - Compiled dex bytecode, including optimized dex bytecode and metadata, native machine code, or a mix of both.
5.    Analyze native memory allocations using malloc debug
Malloc debug is a method of debugging native memory problems. It can help detect memory corruption, memory leaks, and use after free issues. You can check this documentation for more understanding and usage.  
 
6.    Use Address Sanitizer to detect memory errors in C/C++ code
Beginning with Android 27, Android NDK supports Address Sanitizer which is a fast compiler-based tool for detecting memory bugs in native code. ASan detects:
      • Stack and heap buffer overflow/underflow
      • Heap use after free
      • Stack use outside scope
      • Double free/wild free

            ASan runs on both 32-bit and 64-bit ARM, plus x86 and x86-64. ASan's CPU overhead is roughly 2x, code size overhead is between 50% and 2x, and the memory overhead is large (dependent on your allocation patterns, but on the order of 2x). To learn more, read here.

            Camera from the Google team used it and automated the process that would run and get back to them in the form of alerts in case of Asan issues, and found it really convenient to fix memory issues missed during code authoring/review.

            Monitoring Startup

            Analyze Startup

            1.    Measure and analyze time spent in major operations
            Once you have a complete app startup trace, look at the trace and measure time taken for major operations like bindApplication, activitystart etc.

            Look at overall time spent to

              • Identify which operations occupy large time frames and can be optimized
              • Identify which operations consume high time where it is not expected.
              • Identify which operations cause the main thread to be blocked
            2.    Analyze and identify different time consuming operations and their possible solutions
              • Identify all time consuming operations.
              • Identify any operations which are not supposed to be executed during startup (Ideally there are a lot of legacy code operations which we are not aware about and not easily visible when looking at our app code for performance)
              • Identify which all operations are absolutely needed OR could be delayed until your first frame is drawn.
            3.    Check Home activity load time
            This is your app’s home page and often performance will depend on the loading of this page. For most apps, there is a lot of data displayed on this page, spanning multiple layouts and processes running in background. Check the home activity layout and specifically look at the Choreographer.onDraw method of the home activity.
              • Measure time taken for overall operations of measure, draw,inflate,animate etc.
              • Look at frame drops.
              • Identify layouts taking high time to render or measure.
              • Identify assets taking a long time to load.
              • Identify layouts not needed but still getting inflated.

            Tools 

             1.    Perfetto
              • To know CPU usage, thread activity, frame rendering time, Perfetto will be the best tool.
              • Record trace either by using command line or UI tools like Perfetto. Add app package name with the -a tag, to filter data for your app. Some ways to capture trace :
              • Produces a report combining data from the Android kernel, such as the CPU scheduler, disk activity, and app threads.
              • Best when enabled with custom tracing to know which method or part of code is taking how long and then develop can dig deep accordingly.
              • Understand Atrace, and ftrace while analyzing traces through Perfetto.
            2.    App Startup library
            The App Startup library provides a straightforward, performant way to initialize components at application startup. Both library developers and app developers can use App Startup to streamline startup sequences and explicitly set the order of initialization. Instead of defining separate content providers for each component you need to initialize, App Startup allows you to define component initializers that share a single content provider. This can significantly improve app startup time. To find how to use it in your app, refer here
             
            3.    Baseline Profiles
            Baseline Profiles are a list of classes and methods included in an APK used by Android Runtime (ART) during installation to pre-compile critical paths to machine code. This is a form of profile guided optimization (PGO) that lets apps optimize startup, reduce jank, and improve performance for end users. Profile rules are compiled into a binary form in the APK, in assets/dexopt/baseline.prof.

            During installation, ART performs Ahead-of-time (AOT) compilation of methods in the profile, resulting in those methods executing faster. If the profile contains methods used in app launch or during frame rendering, the user experiences faster launch times and/or reduced jank. For more information on usage and advantages, refer here.  

            4.    Android CPU Profiler
            You can use the CPU Profiler to inspect your app’s CPU usage and thread activity in real time while interacting with your app, or you can inspect the details in recorded method traces, function traces, and system traces. The detailed information that the CPU Profiler records and shows is determined by which recording configuration you choose:
              • System Trace: Captures fine-grained details that allow you to inspect how your app interacts with system resources.
              • Method and function traces: For each thread in your app process, you can find out which methods (Java) or functions (C/C++) are executed over a period, and the CPU resources each method or function consumes during its execution.
            5.    Debug API + CPU Profiler
            To give apps the ability to start and stop recording CPU profiling and then inspect in CPU profiler is what Debug API is all about. It provides information about tracing and allocation counts the same way using startMethodTracing() and stopMethodTracing().
             

            Debug.startMethodTracing("sample") - Starts recording a trace log with the name you provide


             Debug.stopMethodTracing() - he system begins buffering the generated trace data, until the

             application calls this method.

            Usage

              • Debug API is designed for short intervals or scenarios that are hard to start/stop recording manually. (Used it once to find the lock contention happening due to some library)
              • To generate a method trace of an app's execution, we can instrument the app using the Debug class. This way developers get more control over exactly when the device starts and stops recording tracing information.
            6.    MacroBenchmark
              • Measures Scrolling / Animation rendering time.
              • Use a UiAutomator to trigger a scroll or animation. (It captures frame timing / janks for whatever the app is doing. Scroll and animations are just the easiest ways to produce frames where jank is noticeable)
              • Requires Android 10 or higher to run the tests.
              • Can view traces on Systrace/Perfetto Traces.
              • FrameTimingMetric is the API reporting frame time in ms.
            This sample can be used for app instrumentation. 
             

              • Added in API level 30 and supported in the latest Studio Bumblebee preview (2021.1)
              • Uses simpleperf with customized build scripts for profiling.
              • Simpleperf supports profiling java code on Android >M.
              • Profiling a release build requires one of following:
                • Device to be rooted
                • Android >=O, use a script wrap.sh and make android::debuggable=“true” to enable profiling.
                • Android >=Q, add profileable in manifest flag.

            <profileable android:shell=["true" | "false"] android:enable=["true" | "false"] />

              • Helpful in app instrumentation with Macrobenchmark.
            8.    MicroBenchmark
            The Jetpack Microbenchmark library allows you to quickly benchmark your Android native code (Kotlin or Java) from within Android Studio. The library handles warmup, measures your code performance and allocation counts, and outputs benchmarking results to both the Android Studio console and a JSON file with more detail. Read more here.

            Monitoring App size

            No user wants to download a large APK that might consume most of their Network/Wifi Bandwidth, also most importantly, space inside the mobile device.

            The size of your APK has an impact on how fast your app loads, how much memory it uses, and how much power it consumes. Reducing your app's download size enables more users to download your app.


            Tools

            • Use the Android Size Analyzer
            The Android Size Analyzer tool is an easy way to identify and implement many strategies for reducing the size of your app. It is available as both an Android Studio plugin as well as a standalone JAR
            • Remove unused resources using Lint
            The lint tool, a static code analyzer included in Android Studio, detects resources in your res/ folder that your code doesn't reference. When the lint tool discovers a potentially unused resource in your project, it prints a message like the following example.

            Note : Libraries that you add to your code may include unused resources. Gradle can automatically remove resources on your behalf if you enable shrinkResources in your app's build.gradle file.

            • Native animated image decoding
            In Android 12 (API level 31), the NDK ImageDecoder API has been expanded to decode all frames and timing data from images that use the animated GIF and animated WebP file formats. When it was introduced in Android 11, this API decoded only the first image from animations in these formats. 
             
            Use ImageDecoder instead of third-party libraries to further decrease APK size and benefit from future updates related to security and performance. 
             
            For more details on the API, refer to the API reference and the sample on GitHub.
            • Crunch PNG files using aapt
            The aapt tool can optimize the image resources placed in res/drawable/ with lossless compression during the build process. For example, the aapt tool can convert a true-color PNG that does not require more than 256 colors to an 8-bit PNG with a color palette. Doing so results in an image of equal quality but a smaller memory footprint. Read more here.

            Note : Please check Android developer documentation for all the useful tools which can help you identify and help fix such performance issues.

            Recap

            This part of the blog captures the tools used by Google to identify and fix performance issues in their apps. They saw great improvements in their metrics. Most Android Go apps could benefit from applying the strategies described above. Optimize and make your app delightful and fast for your users!

            What is Wi-Fi 6E on the Nest Wifi Pro?

            Earlier this month we announced our latest mesh Wi-Fi system, Nest Wifi Pro. With a new design, faster speeds and simple set-up, Nest Wifi Pro is a solid foundation for your smart home, supporting up to 100 devices per router. And it’s officially available today.

            One of Nest Wifi Pro’s biggest perks is that it uses Wi-Fi 6E, the most advanced Wi-Fi technology in over 20 years. But what exactly is Wi-Fi 6E and how does it improve your connection? Let’s dig a little deeper.

            New, open radio band

            Wi-Fi 6E is an extension of Wi-Fi 6 (hence the “E”). Unlike previous Wi-Fi generations, it can access a wider and less crowded radio band — 6 GHz — for even faster speeds and performance. With the ability to access this new band, as well as the standard 2.4 GHz and 5 GHz radio bands most Wi-Fi systems use, Nest Wifi Pro has a true tri-band connection. As a result, it offers speeds up to two times faster than Wi-Fi 6[7128ae].

            Less latency and faster connections

            Wi-Fi 6E is still early in its adoption, so it’s not overly crowded. With less network congestion, Wi-Fi 6E improves your speed and reduces your chance of interference, making connections faster and smoother than before. With more room to operate, 6E can also handle multiple high-bandwidth activities, like streaming 4K movies or taking video conference calls from home — or all of them at once.

            We like to think of 6E as driving in the fast lane on a super highway, providing a clearer and more direct path to get you where you want to go.

            Works with all devices

            Even though Nest Wifi Pro is built with advanced Wi-Fi 6E technology, it’s still compatible with older devices like laptops and phones. That’s because it can access all three radio bands, allowing it to easily connect to your existing devices while setting it up to support the next generation of technology.

            And with Matter, coming soon via software update, you’ll enjoy the advantages of the new standard for in-home connectivity — like access to more smart devices, more customization and expanded coverage for your home.

            Nest Wifi Pro retails at $399.99 for a three pack, $299.99 for a two pack or $199.99 for a one pack. Check out the Google Store to learn even more about Nest Wifi Pro and to order yours today.