|
|
JAVA and SHARK
|
|
|
|
Junior Member
Join Date: Jan 2003
Location: Dartmouth College, NH
Status:
Offline
|
|
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
|
|
|
|
|
|
|
|
|
Registered User
Join Date: Jan 2005
Location: there are days when I wake up and thats exactly my question
Status:
Offline
|
|
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.
|
|
|
|
|
|
|
|
|
Fresh-Faced Recruit
Join Date: Aug 2005
Status:
Offline
|
|
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.
|
|
|
|
|
|
|
|
|
Registered User
Join Date: Jan 2005
Location: there are days when I wake up and thats exactly my question
Status:
Offline
|
|
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 Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|