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

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


All times are GMT -5. The time now is 11:17 PM.

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

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