Saturday, 10 October 2015 Andrew Woods, Thomas Adam, Matthew Welch Memory Leaks Presentation Matthew Welch Thomas Adam Andrew Woods.

Slides:



Advertisements
Similar presentations
Part IV: Memory Management
Advertisements

CMSC 330: Organization of Programming Languages Memory and Garbage Collection.
Lecture 10: Heap Management CS 540 GMU Spring 2009.
CMSC 330: Organization of Programming Languages Memory and Garbage Collection.
5. Memory Management From: Chapter 5, Modern Compiler Design, by Dick Grunt et al.
Garbage Collection CSCI 2720 Spring Static vs. Dynamic Allocation Early versions of Fortran –All memory was static C –Mix of static and dynamic.
Linux vs. Windows. Linux  Linux was originally built by Linus Torvalds at the University of Helsinki in  Linux is a Unix-like, Kernal-based, fully.
Chapter 11: File System Implementation
Chapter 4: Threads. Overview Multithreading Models Threading Issues Pthreads Windows XP Threads.
Mobile Handset Memory Management
File System Implementation
Memory Allocation. Three kinds of memory Fixed memory Stack memory Heap memory.
Memory Management 2010.
Informationsteknologi Friday, November 16, 2007Computer Architecture I - Class 121 Today’s class Operating System Machine Level.
Memory Allocation and Garbage Collection. Why Dynamic Memory? We cannot know memory requirements in advance when the program is written. We cannot know.
Operating Systems CS208. What is Operating System? It is a program. It is the first piece of software to run after the system boots. It coordinates the.
UniProcessor Garbage Collection Techniques Paul R. Wilson University of Texas Presented By Naomi Sapir Tel-Aviv University.
System Software, functions of an operating system
Computer Software.
Embedded Java Research Geoffrey Beers Peter Jantz December 18, 2001.
Lesson 4 Computer Software
Tutorial 6 Memory Management
Tutorial 7 Memory Management presented by: Antonio Maiorano Paul Di Marco.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 8: Main Memory.
Operating Systems Chapter 8
MEMORY MANAGEMENT Presented By:- Lect. Puneet Gupta G.P.C.G. Patiala.
Computing and the Web Operating Systems. Overview n What is an Operating System n Booting the Computer n User Interfaces n Files and File Management n.
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.
File System Implementation Chapter 12. File system Organization Application programs Application programs Logical file system Logical file system manages.
Reliability and Recovery CS Introduction to Operating Systems.
OPERATING SYSTEMS Lecture 3: we will explore the role of the operating system in a computer Networks and Communication Department 1.
Chapter 4 Memory Management Virtual Memory.
Memory Management COSC 513 Presentation Jun Tian 08/17/2000.
Memory Management. Memory  Commemoration or Remembrance.
Memory. Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation.
1 Advanced Memory Management Techniques  static vs. dynamic kernel memory allocation  resource map allocation  power-of-two free list allocation  buddy.
File System Implementation
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 10: Virtual Memory Background Demand Paging Page Replacement Allocation of.
Mac OS X December 5, 2005 Fall 2005 Term Project CS450 Operating Systems (Section 2) Darrell Hall, Ryan Lanman, Chris Sanford, John Suarez {halldl, lanmanrm,
Main Memory. Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Example: The.
UniProcessor Garbage Collection Techniques Paul R. Wilson University of Texas Presented By Naomi Sapir Tel-Aviv University.
I MPLEMENTING FILES. Contiguous Allocation:  The simplest allocation scheme is to store each file as a contiguous run of disk blocks (a 50-KB file would.
Processes and Virtual Memory
UNIX & Windows NT Name: Jing Bai ID: Date:8/28/00.
Memory Management -Memory allocation -Garbage collection.
Memory Management OS Fazal Rehman Shamil. swapping Swapping concept comes in terms of process scheduling. Swapping is basically implemented by Medium.
COMP091 – Operating Systems 1 Memory Management. Memory Management Terms Physical address –Actual address as seen by memory unit Logical address –Address.
Memory Management Chapter 5 Advanced Operating System.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 8: Main Memory.
Operating System Basics. Outline The User Interface Running Programs Managing Files Managing Hardware Utility Software.
Chapter 2 Operating Systems
File-System Management
File-System Implementation
CSC 322 Operating Systems Concepts Lecture - 12: by
Lesson Objectives Aims Key Words
CSI 400/500 Operating Systems Spring 2009
Main Memory Management
Chapter 9: Virtual-Memory Management
MEMORY MANAGEMENT & their issues
Page Replacement.
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.
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
PC Operating Systems in Review
Presentation made by Steponas Šipaila
COMP755 Advanced Operating Systems
Mr. M. D. Jamadar Assistant Professor
CMPE 152: Compiler Design May 2 Class Meeting
Presentation transcript:

Saturday, 10 October 2015 Andrew Woods, Thomas Adam, Matthew Welch Memory Leaks Presentation Matthew Welch Thomas Adam Andrew Woods

Saturday, 10 October 2015 Andrew Woods, Thomas Adam, Matthew Welch Introduction What memory leakage is; How it is handled under: –Windows; –Linux; –MAC OS; Methods that the OS uses to handle memory leaks; Various third-party applications that handle memory leakage; Our own conclusions about how to handle memory leakage;

Saturday, 10 October 2015 Andrew Woods, Thomas Adam, Matthew Welch Memory Leakage Continual allocation of memory to a process; Memory is never freed; System becomes unresponsive;

Saturday, 10 October 2015 Andrew Woods, Thomas Adam, Matthew Welch Windows Virtual Memory ; Process creation allows entire swap file; Dynamic Link Libraries (dll's) are usually the culprit;

Saturday, 10 October 2015 Andrew Woods, Thomas Adam, Matthew Welch Linux Linux kernel 2.2.X onwards defines Out Of Memory (OOM-killer); Processes therefore aren't allowed to consume the entire VM; Self-preservation of the kernel; Parent/Child hierarchy of processes; Uninterruptible sleep means the parent process must die;

Saturday, 10 October 2015 Andrew Woods, Thomas Adam, Matthew Welch Mac OS Mac OS 6 had poor memory design features; Memory allocated via the concept of pointers; Fragmentation; MacOS 9 onwards uses techniques from Linux; Memory leaks mostly confined to applications;

Saturday, 10 October 2015 Andrew Woods, Thomas Adam, Matthew Welch Introduction to Memory Recovery Plugging memory leaks is very similar to doing Garbage Collection. Not normally done at the OS level, but at the sandbox / virtual machine level. Time and performance issues.

Saturday, 10 October 2015 Andrew Woods, Thomas Adam, Matthew Welch Reference Counting References additions/deletions are kept track of. When a block has no references, it may be deleted. Very easy to get into a situation where memory is not recovered.

Saturday, 10 October 2015 Andrew Woods, Thomas Adam, Matthew Welch Mark and Sweep Two stage process Mark – System goes from known memory references (program stack, global variables, and CPU registers) Sweep – Any areas not marked are freed for re-use.

Saturday, 10 October 2015 Andrew Woods, Thomas Adam, Matthew Welch Stop and Copy Similar to Mark and Sweep, Works against fragmentation also Only instead of Sweep, allocated data is copied to a different area

Saturday, 10 October 2015 Andrew Woods, Thomas Adam, Matthew Welch Reference Searching Search of *all* memory held by the program. Considers that any data held in memory could be a memory reference. Quite slow. Single pass. Can be done repeatedly for better performance. May not recover all lost memory – a conservative approach.

Saturday, 10 October 2015 Andrew Woods, Thomas Adam, Matthew Welch Smart Pointers and Custom Libraries Not an algorithm, more of a programming technique. Available for many languages, especially C, C++ Normal pointers are ‘operator overloaded’ Prevent dangling pointers, lost objects. Can provide automatic memory freeing. Override the standard memory allocation functions to provide more functionality.

Saturday, 10 October 2015 Andrew Woods, Thomas Adam, Matthew Welch Final Note State of the art Garbage Collection is still improving in terms of: Execution time Incremental and interruptible Approaching suitability for near-real-time systems.

Saturday, 10 October 2015 Andrew Woods, Thomas Adam, Matthew Welch Taking a look at three products that are meant to make memory management easier.

Saturday, 10 October 2015 Andrew Woods, Thomas Adam, Matthew Welch Why The Need For A Third Party Program Windows Poorly programmed applications Memory leaks Types of memory management software available –Programming Environment –Application Environment

Saturday, 10 October 2015 Andrew Woods, Thomas Adam, Matthew Welch Programs Available Linux Environment –Dynamic Leak Check –Qps –Memtester –Asmem Windows Environment –MemDefrag 2 –MemOptimizer –MemMonster –Release RAM –RamCleaner –Clean Ram –SuperRam –Alto Memory Booster –MemTurbo

Saturday, 10 October 2015 Andrew Woods, Thomas Adam, Matthew Welch MemMonster Rating for memMonster Price£25 Value for money4 File Size KB785 KB Ease of use3 Flexibility/Functions3 Appearance on screen3 Increase in performance300% Operating SystemWindows 98/ME/NT/2K/XP and 2003 DeveloperMagellass Corp Rating 1 out of 53

Saturday, 10 October 2015 Andrew Woods, Thomas Adam, Matthew Welch Alto Memory Booster Rating for Alto memory Price£11.10 Value for money2 File Size KB1,573 KB Ease of use3 Flexibility/Functions2 Appearance on screen5 Increase in performance200% Operating SystemWindows 98/ME/NT/2000 and XP DeveloperAlto Software Rating 1 out of 53

Saturday, 10 October 2015 Andrew Woods, Thomas Adam, Matthew Welch MemTurbo Rating for memTurbo Price£29.95 Value for money4 File Size KB796 KB Ease of use4 Flexibility/Functions4 Appearance on screen5 Increase in performance200% Operating SystemWindows 95/98/NT 4.0/2000 and XP DeveloperSoftwareOnline Rating 1 out of 54

Saturday, 10 October 2015 Andrew Woods, Thomas Adam, Matthew Welch Conclusion Comparing & Contrasting Software Programs Reviewed memTurbomemMonsterAlto memory Pros  Aim at a more professional due to Advanced capabilities  Reliability and robust  Free support for end-user  Good help guide  Navigation & GUI to a high quality and standard Pros  Most middle range of the three packages both in features, functions and price  Easy to configure  Offers settings for disk caching  Good value for money Pros  Familiarity, especially on the desktop (icons)  Windows configuration wizard for auto-set-up  Less training needed for users  Easy to get started  Most cost effective Cons  Least cost effective  More training required Cons  Exaggerated claims for performance (not 300% in trail review)  Navigation is poor & not clearly defined Cons  Lacking features and advanced functions  Not as an effective memory management software program compared to memTurbo or memMonster  Double the file size compared to memTurbo & memMonster  Questionable reliability and efficiency Top range package for middle to advance user Middle range package for novice to beginner Lower range package for beginner

Saturday, 10 October 2015 Andrew Woods, Thomas Adam, Matthew Welch Towards a Leak Free OS? First Line: ‘Mark and Sweep’ Second Line: Restricting the number of memory pages that the process may consume. Why? Effectiveness: These methods combined should effectively: –Prevent memory leakage, by recovering memory from leaky processes –For runaway processes, terminating them. Disadvantages –Timing –Interruptions for GC