OSX Java application using awt always switches MacBook to discrete graphics. Bug or feature?

Mike Swingler swingler at apple.com
Thu Sep 6 17:14:14 PDT 2012


On Aug 30, 2012, at 12:35 PM, Claudio Nieder <private at claudio.ch> wrote:

> Hi,
> 
> I notice that all my Java applications which use AWT libraries in any form switches my MacBook Pro Retina to the (more battery consuming) discrete graphics mode, even when drawing very simple things.
> 
> The following small program is enough to trigger the switch though it does not even open a window or draw anything.
> 
> import java.awt.GraphicsEnvironment;
> public class Sleep
> {
> public static final void main(final String[] args) throws InterruptedException
> {
>  final GraphicsEnvironment b=GraphicsEnvironment.getLocalGraphicsEnvironment();
>  Thread.sleep(Long.MAX_VALUE);
> }
> }
> 
> Is this "bad behavior by design" or shall I file a bug report?
> 
> I observe this with JDK 7u8-b04 on OS X 10.8.1
> $ java -version
> java version "1.7.0_08-ea"
> Java(TM) SE Runtime Environment (build 1.7.0_08-ea-b04)
> Java HotSpot(TM) 64-Bit Server VM (build 23.4-b01, mixed mode)
> $ uname -a
> Darwin Claudios-MacBook-Pro.local 12.1.0 Darwin Kernel Version 12.1.0: Tue Aug 14 13:29:55 PDT 2012; root:xnu-2050.9.2~1/RELEASE_X86_64 x86_64

When in doubt, please file a bug report.

(and no, this should not be the case - Java should fall back to integrated GPU, or software-only GL, dynamically, as the OS decides to change based on "current conditions", like if you are plugged into power or other external displays, etc).

Regards,
Mike Swingler
Apple Inc.



More information about the macosx-port-dev mailing list