FastMM in Depth - PowerPoint PPT Presentation

About This Presentation
Title:

FastMM in Depth

Description:

FastMM in Depth Primo Gabrijel i , primoz_at_gabrijelcic.org www.thedelphigeek.com Memory Management Memory Management Do I really have to know anything about ... – PowerPoint PPT presentation

Number of Views:38
Avg rating:3.0/5.0
Slides: 15
Provided by: Simona169
Category:

less

Transcript and Presenter's Notes

Title: FastMM in Depth


1
FastMM in Depth
  • Primož Gabrijelcic, primoz_at_gabrijelcic.org
  • www.thedelphigeek.com

2
Memory Management
3
Memory Management
  • Do I really have to know anythingabout memory
    management?
  • No!
  • Unless you live in the real world ?

strings
handles
forms
windows
objects
brushes
http
files
4
Behind the Scene
  • A simple program
  • a 'The answer is'
  • a a ' ' IntToStr(42)
  • causes not so simple flow of events.

The answer is 42
The answer is
The answer is
42
5
Allocate, Release
  • Allocate
  • TClass.Create, GetMem, AllocateMem, New,
    CreateWindow,Handle,File
  • Release
  • object.Destroy/Free, FreeMem, Dispose,
    CloseHandle
  • Or in Delphi terms Create, GetMem, AllocateMem
    Destroy, Free, FreeMem
  • .NET is different

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

7
Bugs, Bugs, Everywhere
  • Reading outside allocated area
  • Writing outside allocated area
  • Using released memory

The answer is 42
header
The answer is 42
header
header
data
Whats up Doc?
My memory block!
header
The answer is 42
My memory block!
Whats up Doc?
8
FastMM 4
9
FastMM4
  • The Fastcode ProjectMemory Manager Challenge
  • Pierre le Riche, fastmm.sourceforge.net
  • Included in Delphi 2006
  • Supports Delphi 4?, C Builder 4?, Kylix 3

10
Delphi MM vs. FastMM4
Delphi MM FastMM4
Speed ? ??
Fragmentation ? ??
Debugging ? ??
Simplicity ? ??
  • Uses FastMM4

11
FastMM4 Internals
  • Three memory managers in one
  • Small blocks (lt 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 (gt 260 KB)
  • Allocated directly by the OS
  • Separate locks

12
Other Memory Managers
  • TopMM
  • www.topsoftwaresite.nl
  • Multithreaded programming
  • SafeMM
  • cc.embarcadero.com/item/27241
  • Debugging

13
Show me the code!
14
Q A
Write a Comment
User Comments (0)
About PowerShow.com