This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: CS3214 Fall 2011 Exercise 6 Due: Thursday, Oct 27, 2011. 11:59pm (no extensions). What to submit: Upload a single ASCII file with your answers. Part 1 of this exercise should be done on the rlogin machines, using the 64-bit com- piler. Part 2 of this exercise requires the Eclipse Memory Analyzer tool (MAT). This tool is installed on the lab machines in /home/courses/cs3214/software/mat/- MemoryAnalyzer , but you may prefer to install it on your own machine for better per- formance. It can be downloaded from http://www.eclipse.org/mat/downloads.php. Memory management bugs are a common problem when using explicit or automatic stor- age allocators. Familiarity with available diagnosis tools and knowing their capabilities and limitations are crucial skills for any productive programmer. 1. Understanding valgrind Memory analysis tools for type-unsafe languages such as C are now in wide use, helping programmers pinpoint many previously hard-to-find bugs. Examples include the open- source program valgrind and commercial products such as Purify. These tools use binary instrumentation to intercept a program’s accesses to memory (though not its use of reg- isters). They maintain a data structure called shadow memory that records for each bit in the actual program’s memory whether it is part of the address ranges a program is legally allowed to access, and whether it has been written to before being read or used in a con- ditional. In addition, they replace the memory allocator with their own implementation in order to intercept when memory regions are deallocated and subsequently rededicated...
View Full Document
- Fall '11
- Garbage collection, allocated memory, Eclipse Memory Analyzer