FastMM in Depth Primož Gabrijelčič,

Slides:



Advertisements
Similar presentations
Borland Optimizeit™ Profiler for the Microsoft .NET Framework
Advertisements

Pokas x86 Emulator for Generic Unpacking By Amr Thabet
Dynamic Memory Management
Parallel Programming with OmniThreadLibrary
File Systems.
An Overview of Palm OS n Designed for special hardware –small screen ( 160 x 160 ) –less processing power than desktop PCs –quick turnaround expected –limited.
1 Optimizing Malloc and Free Professor Jennifer Rexford COS 217 Reading: Section 8.7 in K&R book
Malloc Recitation Section K (Kevin Su) November 5 th, 2012.
Flash: An efficient and portable Web server Authors: Vivek S. Pai, Peter Druschel, Willy Zwaenepoel Presented at the Usenix Technical Conference, June.
Lecture 5: Floodfill. Floodfill Overview First assume that there are no walls Give each cell a distance from the goal. The goal has distance 0. Repeat.
Parallel Programming Made Easy Primož Gabrijelčič,
Continuously Recording Program Execution for Deterministic Replay Debugging.
ITouch/iPhone SDK A study using Cognitive Dimensions.
Visual Studio / Haskell Simon Marlow Krasimir Angelov + others.
1 Optimizing Malloc and Free Professor Jennifer Rexford
CS533 Concepts of Operating Systems Class 3 Integrated Task and Stack Management.
File System Implementation
. Memory Management. Memory Organization u During run time, variables can be stored in one of three “pools”  Stack  Static heap  Dynamic heap.
1 Chapter 3.1 : Memory Management Storage hierarchy Storage hierarchy Important memory terms Important memory terms Earlier memory allocation schemes Earlier.
Pleasures and Pitfalls of Profiling Primož Gabrijelčič.
CSCI 224 Introduction to Java Programming. Course Objectives  Learn the Java programming language: Syntax, Idioms Patterns, Styles  Become comfortable.
Building Multithreaded Solutions with OmniThreadLibrary
Destroy the Castle – Example Instructions. Functional Decomposition2 Lab 1 Activity 1 Build, Run, and Benchmark.
Dynamic Partition Allocation Allocate memory depending on requirements Partitions adjust depending on memory size Requires relocatable code –Works best.
Java Introduction Lecture 1. Java Powerful, object-oriented language Free SDK and many resources at
Natalia Yastrebova What is Coverity? Each developer should answer to some very simple, yet difficult to answer questions: How do I find new.
Node.js - What is Node.js? -
Threaded Applications Introducing additional threads in a Delphi application is easy.
Component 4: Introduction to Information and Computer Science Unit 4: Application and System Software Lecture 3 This material was developed by Oregon Health.
Strategies for Transferring User Data Files in your WP7 Apps By Jay E. Kimble The Dev Theologian
Chapter 3.5 Memory and I/O Systems. 2 Memory Management Memory problems are one of the leading causes of bugs in programs (60-80%) MUCH worse in languages.
CSC 322 Operating Systems Concepts Lecture - 20: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
SIMPLE PARALLEL PROGRAMMING WITH PATTERNS AND OMNITHREADLIBRARY PRIMOŽ GABRIJELČIČ SKYPE: GABR42
Operating Systems Session 1. Contact details TA: Alexander(Sasha) Apartsin ◦ ◦ Office hours: Homepage:
CRT State Stuff Dana Robinson The HDF Group. In the next slide, I show a single executable linked to three dlls. Two dlls and the executable were built.
Readers choice 1999 Most affordable database 1998 Database of the year 1998.
2003 Dominic Swayne1 Microsoft Disk Operating System and PC DOS CS-550-1: Operating Systems Fall 2003 Dominic Swayne.
CMS ECAL Week, July 20021Eric CANO, CERN/EP-CMD FEDkit FED Slink64 readout kit Dominique Gigi, Eric Cano (CERN EP/CMD)
CS 241 Section Week #9 (11/05/09). Topics MP6 Overview Memory Management Virtual Memory Page Tables.
Chapter 3: Where are programs and data Stored?. How important is this chapter to understanding how a computer works? 7 (on a scale of 1-10 with 10 being.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Memory Management Overview.
C++ 程序语言设计 Chapter 12: Dynamic Object Creation. Outline  Object creation process  Overloading new & delete.
Consider Starting with 160 k of memory do: Starting with 160 k of memory do: Allocate p1 (50 k) Allocate p1 (50 k) Allocate p2 (30 k) Allocate p2 (30 k)
Memory Management What if pgm mem > main mem ?. Memory Management What if pgm mem > main mem ? Overlays – program controlled.
Introduction to threads
Introduction to Systems Programming (CS 0449)
Memory Management Chapter 7.
Chapter 3: Windows7 Part 5.
Faster parallel programs with improved FastMM
Chapter 4: Multithreaded Programming
Device Drivers, FAT, Queuing Theory, Memory Mapped Files
Module IV Memory Organization.
Node.Js Server Side Javascript
Chapter 3: Windows7 Part 5.
Optimizing Malloc and Free
Lecture 25: Introduction to Memory Management
Chapter 4: Threads.
How I Learned to Love FastMM Internals
Handles disk file 0000: array of file-offsets 0001: 0002: 0003: 0: …
Chapter 8: Memory management
Outline Module 1 and 2 dealt with processes, scheduling and synchronization Next two modules will deal with memory and storage Processes require data to.
Memory Management Overview
Writing High Performance Delphi Applications
Optimizing Dynamic Memory Management
Chapter 10-1: Dynamic Memory Allocation
COMP755 Advanced Operating Systems
Lecture Topics: 11/1 Hand back midterms
CSE 542: Operating Systems
Challenge Guide Grade Code Type Slides
Lecture 25: Introduction to Memory Management
Presentation transcript:

FastMM in Depth Primož Gabrijelčič,

Memory Management

“Do I really have to know anything about memory management?” No! Unless you live in the real world  strings forms objects files brushes handles windows http

‘The answer is’ Behind the Scene A simple program … a := 'The answer is'; a := a + ' ' + IntToStr(42); … causes not so simple flow of events. ‘42’ ‘The answer is 42’

Allocate, Release Allocate – TClass.Create, GetMem, AllocateMem, New, Create[Window,Handle,File…] Release – object.Destroy/Free, FreeMem, Dispose, CloseHandle – Or in Delphi terms: Create, GetMem, AllocateMem …; Destroy, Free, FreeMem.NET is different

Memory Manager In the operating system In the runtime library – Intermediary between the application and OS Speed Decreased fragmentation

‘What’s up Doc?’‘My memory block!’ Bugs, Bugs, Everywhere Reading outside allocated area Writing outside allocated area Using released memory ‘The answer is 42’header ‘The answer is 42’header data header‘The answer is 42’‘My memory block!’‘What’s up Doc?’

FastMM 4

The Fastcode Project Memory Manager Challenge Pierre le Riche, fastmm.sourceforge.net Included in Delphi 2006 Supports Delphi 4⇨, C++ Builder 4⇨, Kylix 3

Delphi MM vs. FastMM4 Delphi MMFastMM4 Speed Fragmentation Debugging  Simplicity Uses FastMM4;

FastMM4 Internals Three memory managers in one – Small blocks (< 2,5 KB) Most frequently used (99%) Medium blocks, subdivided into small blocks – Medium blocks (2,5 – 260 KB) Allocated in chunks (1,25 MB) and subdivided into lists – Large blocks (> 260 KB) Allocated directly by the OS – Separate locks

Other Memory Managers TopMM – – Multithreaded programming SafeMM – cc.embarcadero.com/item/27241 cc.embarcadero.com/item/27241 – Debugging

Show me the code!

Q & A