Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Shark Leaving Files Open (was Re: Shark is the BOMB!)



Hi Dave,

Thanks for the test program - the problem you encountered is separate from John's. It is related to executing the test program with a relative path. Shark checks the dates of executables to see if it needs to re-cache symbol, source file and program text information (expensive!). In the case of an process executed from a binary with a relative path (e.g. ./mytest), Shark can't check the date - it can just look at the location of the executable and frameworks in memory. If that matches (as it did in your test case) it reuses the already cached info.

Although executing your test program with an absolute path is a work-around, the good news is that a better and more complete solution has been found that should fix this problem for good. This fix will show up in the next update of Shark.

--
Nathan Slingerland
Architecture and Performance Group
Apple Computer, Inc.

Begin forwarded message:

From: John Stiles <email@hidden>
Date: October 14, 2004 8:36:53 PM EDT
To: "Gohara, David " <email@hidden>
Cc: Performance optimization list <email@hidden>
Subject: Re: Shark is the BOMB!


Once Shark opens an executable to read its symbols etc, it leaves it open. Other processes can't write to it. This leads to fun situations, i.e. imagine this scenario:
(a) Build and launch your app via Xcode
(b) Shark it, and don't quit Shark when you're done
(c) Quit your app, change some stuff and rebuild it


At this point, even if you've rebuilt, the old code is still on the hard drive because Shark still has it open.
Once you quit Shark you will be able to write to the app again.
CodeWarrior puts up a handy error message in this case but it sounds like Xcode might just continue on, re-launching the old bits on the hard disk.



On Oct 14, 2004, at 5:34 PM, Gohara, David wrote:

Hi All,

  Regarding Shark, which I agree is great. I just installed the new CHUD package (I previously had 4.0.0b11 installed).  If I compile an app with debug symbols on and profile the program Shark works fine.  But if I go and change the code, recompile (with Shark still open) and reprofile the code in Shark doesn't update.  I tried rebooting the system just to be sure there weren't any old electrons floating around etc...  It seems to get Shark to update to the new code, I have to shut it down and restart before each profiling session. 

  I uninstalled CHUD 4.0.0 final and reinstalled the beta and everything worked fine again.

  Has anyone else noticed this, or is there a caching feature that is new that I missed in preferences?  I'm using 10.3.5 and Xcode 1.5, if that helps any.

   Thanks in advance,

 Dave

 David W. Gohara, Ph.D.
 Harvard Medical School
http://www.scianafilms.com
 617-432-1216 (p)
 617-432-4360 (f)

_______________________________________________ Do not post admin requests to the list. They will be ignored. PerfOptimization-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/perfoptimization-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.