Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jan 4, 2013, 10:28 AM   #1
DenBeke
macrumors regular
 
Join Date: Aug 2011
Location: Antwerp
Valgrind on Mac

Are there any alternatives to Valgrind for finding memory leaks? (or precompiled binaries?)

I don't seem smart enough to install it here, and I don't find any good alternative.

Instruments, that comes with Xcode, isn't helping me neither. It keeps saying there are 'living bytes', although Valgrind (on Linux) says everything is ok.
DenBeke is offline   0 Reply With Quote
Old Jan 4, 2013, 10:44 AM   #2
subsonix
macrumors 68030
 
Join Date: Feb 2008
Quote:
Originally Posted by DenBeke View Post
Instruments, that comes with Xcode, isn't helping me neither. It keeps saying there are 'living bytes', although Valgrind (on Linux) says everything is ok.
Instruments would be fine. Living bytes does not necessarily mean you have a leak, it's the total amount of memory in use at current time.
subsonix is offline   0 Reply With Quote
Old Jan 4, 2013, 11:22 AM   #3
DenBeke
Thread Starter
macrumors regular
 
Join Date: Aug 2011
Location: Antwerp
Well, maybe I'm just totally wrong,
but I made a simple Linked List (C++).

In that list I add 8 items, which uses dynamic memory. Thus overall number of allocations will be 8. The destructors runs through all items and deletes it. So at the end, there should be 0 living. Instruments says 1.

DenBeke is offline   0 Reply With Quote
Old Jan 4, 2013, 12:02 PM   #4
gnasher729
macrumors G5
 
gnasher729's Avatar
 
Join Date: Nov 2005
Quote:
Originally Posted by DenBeke View Post
Well, maybe I'm just totally wrong,
but I made a simple Linked List (C++).

In that list I add 8 items, which uses dynamic memory. Thus overall number of allocations will be 8. The destructors runs through all items and deletes it. So at the end, there should be 0 living. Instruments says 1.

Image
1. The C++ runtime system doesn't always do what you think it does.
2. We have no idea what your linked list code does. It may delete the items or it may not.
gnasher729 is offline   0 Reply With Quote
Old Jan 4, 2013, 12:12 PM   #5
DenBeke
Thread Starter
macrumors regular
 
Join Date: Aug 2011
Location: Antwerp
Well, I placed the code on my website: http://denbeke.be/blog/linked-list-memory-leak/
As I said before, Valgrind says it has no leaks.
DenBeke is offline   0 Reply With Quote
Old Jan 6, 2013, 09:14 AM   #6
DenBeke
Thread Starter
macrumors regular
 
Join Date: Aug 2011
Location: Antwerp
Nobody who knows an alternative to Valgrind?
DenBeke is offline   0 Reply With Quote
Old Jan 6, 2013, 05:40 PM   #7
subsonix
macrumors 68030
 
Join Date: Feb 2008
Quote:
Originally Posted by DenBeke View Post
Nobody who knows an alternative to Valgrind?
Yes.
subsonix is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Tags
valgrind, xcode

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
mac to windows and ten years later back to Mac, need some alternative app suggestions debudebu Mac Applications and Mac App Store 1 Apr 5, 2014 02:53 PM
Migration assistant (Mac - Mac). New mac has mutiple drives, can't pick the right one Daftones MacBook Pro 4 Aug 29, 2013 09:32 AM
Linux and mac shared Data partition. (paragon extFS-mac, ntfs-mac, ntfs-3G ?) HiDeHo OS X 10.8 Mountain Lion 15 Jul 17, 2013 05:09 PM
Compiling Valgrind on OS X 10.8 Mountain Lion mcourteaux iPhone/iPad Programming 4 Jul 29, 2012 08:54 PM
Valgrind running on PowerPc but does not report any leaks? maddybit Mac Programming 0 Jul 11, 2012 03:57 AM

Forum Jump

All times are GMT -5. The time now is 08:41 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC