Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jun 14th, 2008, 11:08 AM   #11
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 754
Rep Power: 3 Jimbo is on a distinguished road
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>
Jimbo is offline   Reply With Quote
Old Jun 14th, 2008, 4:30 PM   #12
Cache
Hobbyist
 
Join Date: Sep 2005
Posts: 261
Rep Power: 4 Cache is on a distinguished road
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.
Cache is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:25 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC