Re: "Leaks" utility

2009-06-12 Thread Ryan Joseph


On Jun 13, 2009, at 12:26 PM, Greg Parker wrote:

Can anyone who uses this utility tell me how to set the this  
environment variable? I'm thinking it's possible this must be set  
via GDB, otherwise I'm not sure where it could get a stack trace  
from. Thank you for helping.


Environment variables can be set in your shell; the syntax depends  
on which shell you use. You can also set environment variables when  
you launch the app inside gdb:


   (gdb) set env MallocStackLogging 1
   (gdb) run



This is what I was looking for, thanks!


For more information about malloc stack logging, read this:
   Mac OS X Debugging Magic
   http://developer.apple.com/technotes/tn2004/tn2124.html


Regards,
Josef

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: "Leaks" utility

2009-06-12 Thread Stephen Blinkhorn

export MallocStackLogging=1

Stephen

On 12 Jun 2009, at 22:29, Ryan Joseph wrote:

I wasn't sure where to post this but Cocoa programmers should know  
as well as any one else I thought.


I have just learned about the "leaks" unix utility for detecting  
memory leaks but I'm not unix savvy enough to understand a point  
mentioned in the man page. Which is:


"If the MallocStackLogging environment variable was set when the  
application was launched, leaks also displays a stack trace  
describing where the buffer was allocated."


Can anyone who uses this utility tell me how to set the this  
environment variable? I'm thinking it's possible this must be set  
via GDB, otherwise I'm not sure where it could get a stack trace  
from. Thank you for helping.


Regards,
Josef

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/stephen.blinkhorn%40audiospillage.com

This email sent to stephen.blinkh...@audiospillage.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: "Leaks" utility

2009-06-12 Thread Greg Parker

On Jun 12, 2009, at 9:29 PM, Ryan Joseph wrote:
I have just learned about the "leaks" unix utility for detecting  
memory leaks but I'm not unix savvy enough to understand a point  
mentioned in the man page. Which is:


"If the MallocStackLogging environment variable was set when the  
application was launched, leaks also displays a stack trace  
describing where the buffer was allocated."


Can anyone who uses this utility tell me how to set the this  
environment variable? I'm thinking it's possible this must be set  
via GDB, otherwise I'm not sure where it could get a stack trace  
from. Thank you for helping.


Environment variables can be set in your shell; the syntax depends on  
which shell you use. You can also set environment variables when you  
launch the app inside gdb:


(gdb) set env MallocStackLogging 1
(gdb) run

For more information about malloc stack logging, read this:
Mac OS X Debugging Magic
http://developer.apple.com/technotes/tn2004/tn2124.html


--
Greg Parker gpar...@apple.com Runtime Wrangler

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: "Leaks" utility

2009-06-12 Thread Ryan Joseph
Thanks, I have only just opened Instruments.app but it's pretty dense.  
Leaks gives a nice clean, fast output if you don't need to analyze it  
too heavily. I just found out about it a few days ago but I recommend  
anyone try it, it's pretty slick to get the results so easily.


On Jun 13, 2009, at 12:11 PM, Joar Wingfors wrote:



On 12 jun 2009, at 22.04, Ryan Joseph wrote:

Thank you, but I'm not using Xcode and need an actual unix  
solution. Knowing the command which was generated from that would  
be useful (maybe it's output into a console someplace?). Thanks  
again.



Even if you're not using Xcode, it's still much easier to access  
this functionality from Instruments by using the Leaks template. It  
sounds like you'd probably want to read the documentation before  
getting started though:





j o a r




Regards,
Josef

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: "Leaks" utility

2009-06-12 Thread Joar Wingfors


On 12 jun 2009, at 22.04, Ryan Joseph wrote:

Thank you, but I'm not using Xcode and need an actual unix solution.  
Knowing the command which was generated from that would be useful  
(maybe it's output into a console someplace?). Thanks again.



Even if you're not using Xcode, it's still much easier to access this  
functionality from Instruments by using the Leaks template. It sounds  
like you'd probably want to read the documentation before getting  
started though:





j o a r


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: "Leaks" utility

2009-06-12 Thread Ryan Joseph
I use my own little IDE that I developed so I can write Pascal with  
Cocoa and wanted to make a light-weight GUI for the leaks utility that  
I could use from my app is the reason for doing this. Otherwise yes,  
using MallocDebug is better. It's really fast and handy to call leaks  
instead of loading MallocDebug.


On Jun 13, 2009, at 12:04 PM, Chris Suter wrote:


Hi Ryan,

On Fri, Jun 12, 2009 at 9:29 PM, Ryan Joseph> wrote:
I wasn't sure where to post this but Cocoa programmers should know  
as well

as any one else I thought.

I have just learned about the "leaks" unix utility for detecting  
memory
leaks but I'm not unix savvy enough to understand a point mentioned  
in the

man page. Which is:

"If the MallocStackLogging environment variable was set when the  
application
was launched, leaks also displays a stack trace describing where  
the buffer

was allocated."

Can anyone who uses this utility tell me how to set the this  
environment
variable? I'm thinking it's possible this must be set via GDB,  
otherwise I'm
not sure where it could get a stack trace from. Thank you for  
helping.


It's easier if you use MallocDebug or Instruments.

Regards,

Chris


Regards,
Josef

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: "Leaks" utility

2009-06-12 Thread Chris Suter
Hi Ryan,

On Fri, Jun 12, 2009 at 9:29 PM, Ryan Joseph wrote:
> I wasn't sure where to post this but Cocoa programmers should know as well
> as any one else I thought.
>
> I have just learned about the "leaks" unix utility for detecting memory
> leaks but I'm not unix savvy enough to understand a point mentioned in the
> man page. Which is:
>
> "If the MallocStackLogging environment variable was set when the application
> was launched, leaks also displays a stack trace describing where the buffer
> was allocated."
>
> Can anyone who uses this utility tell me how to set the this environment
> variable? I'm thinking it's possible this must be set via GDB, otherwise I'm
> not sure where it could get a stack trace from. Thank you for helping.

It's easier if you use MallocDebug or Instruments.

Regards,

Chris
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: "Leaks" utility

2009-06-12 Thread Ryan Joseph
Thank you, but I'm not using Xcode and need an actual unix solution.  
Knowing the command which was generated from that would be useful  
(maybe it's output into a console someplace?). Thanks again.


On Jun 13, 2009, at 11:59 AM, Dave Keck wrote:


In Xcode: in the left column, under the "Executables" disclosure
group, double-click your executable. Click the 'Arguments' tab at the
top, and in the bottom section of that window, you can set environment
variables for when your app is launched.


Regards,
Josef

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: "Leaks" utility

2009-06-12 Thread Dave Keck
In Xcode: in the left column, under the "Executables" disclosure
group, double-click your executable. Click the 'Arguments' tab at the
top, and in the bottom section of that window, you can set environment
variables for when your app is launched.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com