![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Battle Programmer
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 754
Rep Power: 3
![]() |
Re: Memory Leaks
@Jabo: you'll never be completely accurate that way. You'd have to account for padding in your structures, the sizes of any libraries you load (and of course, you'd have to do the calculations for those libraries too), etc... It would be a nightmare.
You can, however, find debuggers that will track memory usage and tell you how much was lost. For example, on Linux, Valgrind is one that does this. You run your program through it, and it will tell you how many blocks you lost and their size.
__________________
<insert disclaimer here> <insert shameless plug for Visual Studio here> |
|
|
|
|
|
#12 |
|
Hobbyist
Join Date: Sep 2005
Posts: 261
Rep Power: 4
![]() |
Re: Memory Leaks
RAII is a common resource management idiom used in C++. Smart pointers (with and without reference counts) probably being the most common application.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Please suggest a C++ source code analysis tool for debugging memory leak | Michael_24 | C++ | 3 | Apr 22nd, 2008 11:06 AM |
| an efficient way to store/lookup memory addresses? | rgba | Software Design and Algorithms | 8 | Feb 13th, 2008 1:54 AM |
| Hexadecimal Memory Address Question | 357mag | C++ | 1 | Jul 8th, 2007 9:19 PM |
| Difficulties with memory leaks and the STL + boost | Jessehk | C++ | 5 | Nov 26th, 2006 12:17 PM |
| Heap vs. Stack memory | Eric the Red | C++ | 11 | Oct 24th, 2006 6:18 PM |