print page


Dynamic Virtual Shared Memory

Start 16. May 2013
End 31. December 2014
Financing Hamburg University of Technology

Project Description

When modelling a concurrent or parallel application the developer usually has the choice between multiprocessing and multithreading. Each model comes with its own benefits and drawbacks, thus potentially influencing an application's performance. Multiprocessing is particulary advantageous because it provides for a higher degree of isolation between concurrent parts of an application when compared to multithreading. On the downside, information exchange between processes is more complex and has higher latency compared to threads. Shared memory is the fastest and most efficient way to share information between processes, but its use is not as straightforward as heap memory management through malloc() and free().

The DVSM library provides applications a simple way to manage shared memory which is similar to heap memory management. The library encapsulates basic operations on shared memory and keeps them transparent to the programmer, hiding all the complexity. The application is supplied with the standard set of memory management functions malloc(), free(), etc. according to the POSIX standard. Since the blocks of memory returned by these functions are located in shared memory, processes and threads are able to access them in arbitrary ways. This requires all processes/threads to be descendant from a common parent process.

The dynamic memory management part of the library consists of Douglas Lea's Allocator (dlmalloc), Version 2.8.6. Thus, it considers the latest knowledge on applications allocation and reclamation behaviour.

Support of multiprocessing is of course a key feature of the library thus it is optimized for concurrency. This is achieved by instantiating the allocator a couple of times and distribute incoming allocations uniformly among those separated allocation areas. Douglas Lea's Allocator allows for independent allocation areas called Mspaces which are used for this purpose.

The technique to distribute allocations among several allocation areas was adapted from ptmalloc2 (allocator in glibc 2.16) and another open source allocator (nedmalloc). Nedmalloc also served as an example of the block caching scheme employed in the library.


Students' theses

Completed Theses