User:Chloe
(→Java: Update section on profilers.) |
(→Eclipse) |
||
Line 20: | Line 20: | ||
=== Eclipse === | === Eclipse === | ||
Eclipse will hang on launch if it didn't exit cleanly (e.g. if the system hangs). | Eclipse will hang on launch if it didn't exit cleanly (e.g. if the system hangs). | ||
− | To resolve this, go into the workspace directory, then delete .metadata/.plugins/ | + | To resolve this, go into the workspace directory, then delete .metadata/.plugins/org.eclipse.core.resources/.safetable/.snap |
== Subversion == | == Subversion == |
Revision as of 22:30, 7 November 2012
Contents |
Java
Evaluating performance on a Mac
VisualVM
Free Java profiler with Mac version (also eclipse plugin I haven't tried yet). Look at the getting started guide or profiling an application.
Instruments
Comes with XCode, find it within XCode under XCode/Developer Tools/Instruments. Can profile Java, but not a Java-specific profiler.
Shark
Update: Shark is no longer supported & doesn't launch on Lion 10.7. Xcode now includes a profiler Instruments. Eclipse Test & Performance Tools aren't supported on Mac OS X due to this bug. However, Mac ships with a profiler (you need to install the development tools), Shark, that supports Java. You can find it at /Developer/Applications/Performance Tools. Here's how to get it working:
- Add -agentlib:Shark to your VM arguments (i.e. in the run configuration for Eclipse)
- Start Shark, and pick 'Java Time Profile' or another Java option in the first drop down
- Start your application
- Click Start in Shark
- Click Stop, or Shark should stop after 30 sec.
Tip: Be aware that Shark does not work with Java running in 64-bit mode. With OS X 10.6 java runs in 64-bit by default. If you give java the "-d32" flag when it starts, it will run in 32 bit mode. Combine this with the "-agentlib:Shark" flag, and then start Shark. You now should be able to profile your Java program using OS X 10.6 and Shark.
Eclipse
Eclipse will hang on launch if it didn't exit cleanly (e.g. if the system hangs). To resolve this, go into the workspace directory, then delete .metadata/.plugins/org.eclipse.core.resources/.safetable/.snap
Subversion
Merging a branch
cd branch_dir svn log -v --stop-on-copy cd trunk_dir svn merge -r min:max branchURL
where min and max are the first and last revision numbers reported from the svn log
command, and branchURL is the url (not working copy path) of the branch to merge from
Diff by revision
svn diff -r N:M file
where N and M are the revision numbers to compare
Revert to a previous version of a file
Find revision number you want
svn log filename
Reverse merge, where num is the revision number you want to revert to
svn merge -r HEAD:num filename
Now you can diff and commit (note updating to the revision number doesn't mark the file as changed, so commit doesn't do anything)