Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Bleeding edge JVM options
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bleeding edge JVM options



On Nov 29, 2010, at 6:53 AM, Benson Margulies wrote:

> There's a recommendation on stack overflow to launch Eclipse with,
> amongst other things, the following options.

What's the URL?

> I'm having something of a
> bad day with my machine locking up (as in, the entire MacBook pro
> locks up),

Does it ever come out of this lock up? Is it just the CPU being at 100% all the time? Keep Activity Monitor running to see what happens. Shark traces could also help you.

> is it possible that some of this is a really bad idea?

Maybe. Let me explain what some of these options mean. Blindly adding options is not a good idea.

> -XX:CompileThreshold=5

You are telling hotspot to compile a java method to native after it has been invoked 5 times. This will cause a lot more methods to be compiled to native adding to memory pressure. Also, a small number means HotSpot may not have enough profiling information to generate the most optimized native code.

> -XX:MaxGCPauseMillis=10

So you're trying to hint to the garbage collector that it should try to limit application pause times to 10ms. That's awfully low. I am not sure what impact this would have. Try increasing this to 2000 or getting rid of this altogether to see what happens.

> -XX:MaxHeapFreeRatio=70

That's the default value so there's no point in passing this.

> -XX:+CMSIncrementalPacing

Set to true by default so again, no need to pass it.

> -XX:+UnlockExperimentalVMOptions

You need this simply for using the G1 GC.

> -XX:+UseG1GC

You're using the new G1 garbage collector. It's a new garbage collector written by Oracle. Use at your own risk. I am not sure how stable this is at the moment.

> -XX:+UseFastAccessorMethods

This is true by default so there's no point in adding it.


Fyi, there are some new flags available for help/diagnosis with VM options.

-XX:+PrintFlagsInitial
This will dump out all the default flag settings before HotSpot processes the passed in flags or does its own ergonomics tweaking.

-XX:+PrintFlagsFinal
This will print the value of the flags after HotSpot is done with processing.

-XX:+PrintCommandLineFlags
Prints the flags passed on command line or set by GC ergonomics.

There's a lot of output here but might give you some insights into the flag values. Documentation on some of these flags can be found at

http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html
http://developer.apple.com/library/mac/#documentation/Java/Reference/Java_VMOptionsRef/Articles/JavaVirtualMachineOptions.html

There's also

http://www.md.pp.ru/~eu/jdk6options.html
http://blog.headius.com/2009/01/my-favorite-hotspot-jvm-flags.html

Pratik _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Bleeding edge JVM options (From: Benson Margulies <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.