PNG's In Mac on Java cause massive CPU usage

Posted by alexganose on Stack Overflow See other posts from Stack Overflow or by alexganose
Published on 2010-05-10T10:03:32Z Indexed on 2010/05/10 10:14 UTC
Read the original article Hit count: 183

Filed under:
|
|
|

Hey, I've been having this problem for a while now and I was hoping someone could help.

I make small games using Java on Mac OSX 1.6.3 and if I use PNG's as the image format my CPU usage by Java skyrockets to say 50% (on a very small 2D game). However if I use GIF as the format my CPU usage by Java stays constant at 10% which is reasonable.

What is causing this problem?? It occurs on every game I develop using PNG's so I always just switch to GIF's.

The problem is now that i need to use a PNG for its variable alpha properties rather than just plain transparency. This is not available using GIF's.

The problem is present on Java SE 6 and previous versions. I am using an early 2009 Mac Book Pro 15".

The problem does not occur on a Windows PC running the same game. The CPU usage due to Java using PNG's on a Windows PC (I have tried XP, Vista and 7) is always constantly low at ~10%.

Any help would be greatly appreciated. Thanks :)

© Stack Overflow or respective owner

Related posts about java

Related posts about mac