KoLmafia causing severe battery drain on MacBook Pro

Zyro

Member
I switched from a Windows laptop to a MacBook Pro recently and noticed that my battery life is way less than advertised. After doing some snooping, I found out that having the KoLmafia application open forced my machine to use the high performances discrete graphics card while on battery (even if I am not actively using mafia and it is just sitting in the background). Closing mafia allowed it to immediately switch to the integrated graphics card, and my projected battery life shot up immediately.

Is it possible to get around this graphics card requirement with mafia, or is it something inherent to Java that you guys have no control over? I know I can just close mafia every time I take my computer out with me, but if there is a way for me to leave it open and not eat up tons of energy, that would be preferable.

I am using the .jar file from http://ci.kolmafia.us/job/Kolmafia/.
 

Zyro

Member

Is there a workaround? I tried downloading Apple's Java 6 (mentioned in the link to not use discrete GPU), but it wouldn't allow me to go past the login screen in mafia, probably on account of being deprecated.

EDIT: Where can I find the Info.plist file for mafia? I am told that the issue may be fixed by adding the key NSSupportsAutomaticGraphicsSwitching.
 
Last edited:

Zyro

Member
I haven’t seen that problem on my MacBook Pro. Are you running the latest version of macOS?

Yes, 10.13.6. Open up your Activity Monitor with KoLmafia open in the background, navigate to the Energy tab, and notice that the graphics card will stay "High Perf." until you quit mafia (and other programs that may also require the discrete GPU).

It's a known problem with Java. There is a workaround, but it requires having access to the Info.plist file, and mafia doesn't have one since it is a standalone jar.
 

Veracity

Developer
Staff member
I am running 10.13.6

I opened the Activity Monitor with KoLmafia open in the background.
I went to the Energy tab.

I don't see anything about "graphics card".
I selected KoLmafia and double clicked it to see its specific "Energy impact".
I don't see anything about "graphics card".

I look at the graph and there is some "energy impact" shown.

I quit KoLmafia .jar file.
The "energy impact" graph goes down.

So, it is a "known problem with Java".
What do you want us to do about it?
Thanks.
 
Top