<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>meandmark.com &#187; Shark</title>
	<atom:link href="http://meandmark.com/blog/tag/shark/feed/" rel="self" type="application/rss+xml" />
	<link>http://meandmark.com/blog</link>
	<description></description>
	<lastBuildDate>Tue, 10 Aug 2010 01:50:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Shark and Java on Snow Leopard</title>
		<link>http://meandmark.com/blog/2010/02/shark-and-java-on-snow-leopard/</link>
		<comments>http://meandmark.com/blog/2010/02/shark-and-java-on-snow-leopard/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 23:34:11 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Mac Development]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Shark]]></category>
		<category><![CDATA[Xcode 3.2]]></category>

		<guid isPermaLink="false">http://meandmark.com/blog/?p=159</guid>
		<description><![CDATA[In my research for the Shark chapter of the new edition of the Xcode book, I had a difficult time getting Shark to profile a Java program in Snow Leopard. I&#8217;m writing this post to spare others my pain. For Java profiling to work with Shark, you must link Shark with the Java virtual machine. [...]]]></description>
			<content:encoded><![CDATA[<p>In my research for the Shark chapter of the new edition of the Xcode book, I had a difficult time getting Shark to profile a Java program in Snow Leopard. I&#8217;m writing this post to spare others my pain.</p>
<p>For Java profiling to work with Shark, you must link Shark with the Java virtual machine. To link Shark with the Java virtual machine, you must add the following flag to the virtual machine:</p>
<p><code> </code></p>
<p><code></p>
<pre>-agentlib:Shark</pre>
<p></code></p>
<p><code> </code></p>
<p>Profiling with Shark on Snow Leopard is complicated by the fact that Snow Leopard initially uses the 64-bit version of the Java virtual machine. Shark does not work with 64-bit Java applications. You must use the 32-bit version of the Java virtual machine to profile with Shark. Add the following flag to the virtual machine</p>
<p><code> </code></p>
<p><code></p>
<pre>-d32</pre>
<p></code></p>
<p><code> </code></p>
<p>If you&#8217;re using Xcode 3.2 to write your Java applications, you must add the flags to the <strong>build.xml</strong> file Xcode includes when you create a Java project. Search <strong>build.xml</strong> for the <strong>&lt;/java&gt;</strong> tag and add the flags before that tag.</p>
<p><code> </code></p>
<p><code></p>
<pre>&lt;jvmarg value="-d32"/&gt;
&lt;jvmarg value="-agentlib:Shark"/&gt;</pre>
<p></code></p>
<p><code> </code></p>
<p>At this point you&#8217;ll be able to use the Java Time Profile and Java Call Trace profiles. You won&#8217;t be able to use the Java Alloc Trace profile because Snow Leopard uses JVM 1.6, and the Java Alloc Trace profile doesn&#8217;t work with it. You will have to install JVM 1.5 to use Java Alloc Trace.</p>
]]></content:encoded>
			<wfw:commentRss>http://meandmark.com/blog/2010/02/shark-and-java-on-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
