Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > JAVA and SHARK

JAVA and SHARK
Thread Tools
kstor
Junior Member
Join Date: Jan 2003
Location: Dartmouth College, NH
Status: Offline
Reply With Quote
Oct 16, 2003, 12:10 AM
 
Hi,

I'm writing a series of small terminal programs in java, which I then compile using javac with the -g option and run using java.

I thought it would be nice to do some optimization using Shark, one of the CHUD tools. I have no problem getting the data from the java thread. However, I can't figure out how to get shark to display my java source code. Even when doing a compile through Project Builder, I can only see disassembled code.

Anyone know how to get Shark to work with Java (preferably compiled with javac), if at all possible?

Thanks,

KStor
     
I was David B.
Registered User
Join Date: Jan 2005
Location: there are days when I wake up and thats exactly my question
Status: Offline
Reply With Quote
Oct 6, 2005, 05:14 AM
 
Originally Posted by kstor
Hi,

I'm writing a series of small terminal programs in java, which I then compile using javac with the -g option and run using java.

I thought it would be nice to do some optimization using Shark, one of the CHUD tools. I have no problem getting the data from the java thread. However, I can't figure out how to get shark to display my java source code. Even when doing a compile through Project Builder, I can only see disassembled code.

Anyone know how to get Shark to work with Java (preferably compiled with javac), if at all possible?

Thanks,

KStor
Hi kstor,

did you solve your problem?
Up to now I used OptimizeIt to profile my java code. But since the program is as expensive as a mac, it would be cool if shark could be used.

I tried to profile java code that I compiled with javac but could not make shark launch or analyse it. Even an XCode produced .app does not work. Shark launches the program but fails to analyse anything.
     
szymczyk
Fresh-Faced Recruit
Join Date: Aug 2005
Status: Offline
Reply With Quote
Oct 6, 2005, 03:00 PM
 
There are three things you have to do to profile Java code with Shark.

1. Make sure you're generating debugging symbols.
2. Use the virtual machine option -XrunShark.
3. Launch your program before profiling it with Shark. Launching the program from Shark doesn't work.

To perform steps 1 and 2, double-click the target name in the Groups and Files list to open the settings window. The Generate debugging symbols checkbox is in the Java Compiler Settings section. The virtual machine option settings are in the Info.plist Entries section under Pure Java Specific.
Mark Szymczyk
Author, Xcode Tools Sensei
http://www.meandmark.com
     
I was David B.
Registered User
Join Date: Jan 2005
Location: there are days when I wake up and thats exactly my question
Status: Offline
Reply With Quote
Oct 7, 2005, 04:46 AM
 
Originally Posted by szymczyk
There are three things you have to do to profile Java code with Shark.

1. Make sure you're generating debugging symbols.
2. Use the virtual machine option -XrunShark.
3. Launch your program before profiling it with Shark. Launching the program from Shark doesn't work.

To perform steps 1 and 2, double-click the target name in the Groups and Files list to open the settings window. The Generate debugging symbols checkbox is in the Java Compiler Settings section. The virtual machine option settings are in the Info.plist Entries section under Pure Java Specific.
Thank you.

Yes, starting a java app with shark does not work. That puzzled me.

Generating debugging symbols means using javac -g from the commandline.
Shark can connect to the java process, if java is started with
java -XrunShark ...
And this means indeed that it is possible to use shark even without XCode. It is not as nice as OptimizeIt but if the choice is to buy a mac or a software I would buy the mac.

The apple vm has also some nice features that are not available on linux or windows.
I will report my experience with shark soon. Since I compile and start java programs from the commandline and not from XCode, this might be of interest.
     
   
 
Forum Links
Forum 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
Top
Privacy Policy
All times are GMT -4. The time now is 02:46 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,