Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

DenBeke

macrumors regular
Original poster
Aug 11, 2011
192
8
Antwerp
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.
 

subsonix

macrumors 68040
Feb 2, 2008
3,551
79
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.
 

DenBeke

macrumors regular
Original poster
Aug 11, 2011
192
8
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.

instruments_linked_list.png
 

gnasher729

Suspended
Nov 25, 2005
17,980
5,565
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.