Introducing 'mesh,' a memory-saving plug-in that could boost phone and computer performance

Introducing 'mesh,' memory-saving plug-in to boost phone and computer performance
A research group co-led by Emery Berger, a professor of computer science at UMass Amherst, has developed a system they call Mesh that can automatically reduce such memory demands. Credit: UMass Amherst

Applications like web browsers or smartphone apps often use a lot of memory. To address this, a research group co-led by Emery Berger, a professor of computer science at the University of Massachusetts Amherst, has developed a system they call Mesh that can automatically reduce such memory demands. Berger is presenting this work today at Cppcon, the C++ conference in Aurora, Colorado.

Berger and colleagues in the College of Information and Computer Science (CICS) expect Mesh to have a substantial impact on the computing world, from mobile applications to desktops to , because no one has previously been able to compact in applications written in or running on top of widely-used languages like C, C++, or Objective C, the language used for iOS apps. 

As the authors explain, programs written in C-like languages can suffer from serious memory fragmentation, where memory is broken up, much like a bad Tetris board, Berger says, so there are many empty gaps in between. "This is how memory gets wasted," he points out. "Imagine a Tetris board where you could stop and reorganize it at any time—this would make the game a lot easier, because you could always squeeze out the empty space. But you can't do this in C, just as you can't do it in Tetris." 

Mesh effectively squeezes out these gaps by taking advantage of a hardware feature called "virtual memory" that is supported by almost all modern computers. "The trick is to find chunks of memory that can be interleaved, sort of like when interlocking gears ," Berger explains. When Mesh finds these chunks, it can reclaim the memory from one of the chunks by combining the two chunks into just one. "This meshing process works because we only change things in 'physical' memory. From the perspective of the program, which can only see 'virtual' memory, nothing has changed. This is powerful because we can do this for any application automatically."

The team reports that the results to date have been extremely promising; for example, using Mesh automatically reduces the memory demands of the Firefox web browser by 16%. For Redis, a popular open source data structure server, Mesh reduces memory demands by almost 40%.

The CICS Mesh team includes professor Emery Berger, an expert in memory management who designed the algorithm that the Mac OS X memory manager is based on, professor Andrew McGregor, a specialist in algorithm design and analysis, and doctoral candidates Bobby Powers and David Tench. Powers is a fourth-year doctoral candidate who also is an infrastructure engineer at Stripe, and Tench is a fifth-year doctoral candidate specializing in randomized algorithms.

In a field where "catastrophic fragmentation" was long accepted as inevitable, their software is a major step forward, the authors point out. "This is something that everyone thought to be impossible," notes McGregor. "After Emery had his key insight, we were able to analyze it theoretically and design an efficient algorithm to implement the idea. Against almost 50 years of conventional wisdom, it's great that we now have a solution to this important problem that not only works in theory, but is practical."

Earlier this year, Berger presented technical details at the ACM SIGPLAN Programming Language Design and Implementation conference (PLDI '19) in Phoenix. In response to the paper, Microsoft programmer and distinguished engineer Miguel de Icaza tweeted that Mesh is a "truly inspiring work, with deep impact. A beautiful idea fully developed. What an amazing contribution to the industry."


Explore further

Key features of Apple's new OS based on technology from UMass Amherst and Amherst College

More information: Mesh: Compacting Memory Management for C/C++ Applications, arXiv:1902.04738 [cs.PL] arxiv.org/abs/1902.04738
Citation: Introducing 'mesh,' a memory-saving plug-in that could boost phone and computer performance (2019, September 20) retrieved 20 October 2019 from https://techxplore.com/news/2019-09-mesh-memory-saving-plug-in-boost.html
This document is subject to copyright. Apart from any fair dealing for the purpose of private study or research, no part may be reproduced without the written permission. The content is provided for information purposes only.
170 shares

Feedback to editors

User comments

Sep 20, 2019
Sounds severely overrated to me. Most space on a HDD is data, and compressed data at that. Programs do not take up much memory in either DRAM or HDD. I'm a professional user and have never been able to load anywhere near the 8GB of DRAM my computer has with programs. And before anyone shouts "video editing" - that is almost entirely data, not program.

Sep 20, 2019
Sounds severely overrated to me. Most space on a HDD is data, and compressed data at that. Programs do not take up much memory in either DRAM or HDD. I'm a professional user and have never been able to load anywhere near the 8GB of DRAM my computer has with programs. And before anyone shouts "video editing" - that is almost entirely data, not program.

Seems a bit narrow minded to me.
There is tons of things that could benefit from better memory management.
Analyzing huge amounts of data either with Neural Nets or other means is now a big part of the industry, and many times the fastest way to do it is to run databases in RAM instead of storage since storage is not fast enough. There is so many applications in which this could help, like hypervisors running many virtual machine, etc.

Sep 20, 2019
@dirk, congrats on having 8g of RAM, not every device does. Also, the article doesnt distinguish program from data. Why do you believe Mesh couldnt be used for data?

Sep 21, 2019
It's called memory defragmentation, complementary to garbage collection (for C++ and C#). I've only been doing it in my programs, using my own memory handler, since 1985 in C on an Amiga 1000. The only "neat" advantage here is using the built in IOMMU pointer handling of virtual memory to facilitate it.

"Running Light without Overbyte" for those that hearken back to a time when code and memory efficiency meant something.

Sep 21, 2019
There is tons of things that could benefit from better memory management.
Analyzing huge amounts of data either with Neural Nets or other means is now a big part of the industry, and many times the fastest way to do it is to run databases in RAM instead of storage since storage is not fast enough. There is so many applications in which this could help, like hypervisors running many virtual machine, etc.


Modern hypervisors already utilize memory page deduplication and copy-on-write (COW) to reduce the size of memory required despite many duplicate operating systems and applications running on the same hardware.

Sep 22, 2019
@dirk, congrats on having 8g of RAM, not every device does. Also, the article doesnt distinguish program from data. Why do you believe Mesh couldnt be used for data?


Generally data is loaded into contiguous memory. Besides, the articles said "programs", although it may well be the diminishing standard of reporting in physorg

Sep 22, 2019
may well be the diminishing standard of reporting in physorg
-The byline says 'Emery Berger, University of Massachusetts Amherst' doesnt it? Maybe it's your own cognition that's diminishing?

Sep 22, 2019
may well be the diminishing standard of reporting in physorg
-The byline says 'Emery Berger, University of Massachusetts Amherst' doesnt it? Maybe it's your own cognition that's diminishing?


So why do we need physorg if we have to look up all the details ourselves? Physorg seems to be making a habit of omitting crucial numerical information

Sep 22, 2019
So why do we need physorg if we have to look up all the details ourselves? Physorg seems to be making a habit of omitting crucial numerical information
These are PRESS RELEASES. You dont edit them. Physorg isn't going to take the time to research a subject they're not experts in and fact check a press release by the institutions sponsoring the research. If you Google a random paragraph, sometimes you can see them repeated verbatim on several other news sites. Imagine if every one of them chose to adulterate it in their own way.

Seriously how long have you been coming here? You ought to know this by now.

Please sign in to add a comment. Registration is free, and takes less than a minute. Read more