Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: GUI performance problems on 10.2. (was: ScreenMenuBar Dead (!!!) Slow)



Here is another observation:

By default, my app uses the system L&F , i.e. Aqua on MAC OS X. When I
change the L&F to "Cross Platform", everything performs OK (I even get the
feeling it is a good deal faster than it was...).

I also tried to compare the -Xprof output under MAC OS X with that of
Windows NT - I can't say I found anything telling. After the GUI is up and
running, -Xprof doesn't output anything (on both systems). Is this a proof
that neither the app not the JVM ("on its own") are doing anything?

I also consulted the release notes and found one paragraph that seemed
interesting:

Radar #2918504: "Java applications suffer severe performance slowdown when
their windows are under the Dock.", "There are certain system configurations
where Java applications will suffer severe performance slowdown when any of
their windows are placed under the Dock."

However, it turned out that the dock is not to blame (I used the suggested
workaround). But could it be that my problem has the same cause?

Another attempt at an explanation: There is a change in the JVM from 10.1.
to 10.2. It is something to do with the GUI, more specifically with the Aqua
L&F.

Obviously, changing the L&F is a kind of workaround. However, I'm afraid my
MAC OS X users won't take this very easy. I'd still appreciate any further
help on this.

Thank you very much, kind regards,

Thomas




> "Thomas Schmidt" <email@hidden> wrote:
>
> >1) I have run the app on MAC OS 10.1. - No problem there!
>
> That's good. It will be a known-working case which you can compare with
> the 10.2 case.
>
> You might want to try -Xprof on 10.1, and compare the time-consumers
> betweeen it and 10.2.
>
>
> >2) I have used the CPU Monitor which tells me quite clearly
> that, while the
> >GUI of my app is not hidden, almost 100% of the CPU capacity is taken
> >(although the app is not really doing anything). When I hide it,
> everything
> >is back to normal again (i.e. about 10% of the CPU capacity
> taken). When I
> >cover the window of my app partly with that of any other app (e.g. the
> >terminal) - which is not the same as hiding it? - things get
> better, but not
> >normal. Running the CPU monitor under MAC OS 10.1. (on a machine with no
> >more than 128 MB RAM, btw) tells me that my app only takes about
> 15% of the
> >CPU capacity, even when its GUI covers the complete screen and I click
> >around in menus (shameless me!).
>
> If overlapping (masking) part of a visible window changes the CPU
> consumption, then one possibility is that something is doing a
> whole lot of
> drawing. When it's in full view, all the pixels have to be drawn to the
> screen. When it's masked by another window, only some of the pixels have
> to be drawn to the screen. And when it's hidden or minimized, nothing has
> to be drawn to the screen.
>
> Finding exactly what Java method is causing this behavior is your goal in
> debugging.
>
>
> >3) I have used "ps aux" from the terminal. Among other things,
> it tells me:
> >
> >PID: 165
> >%CPU: 91.9
> >...
> >COMMAND: /System/Library/CoreServices/WindowServer -daemon
>
> Something is causing the WindowServer daemon to consume CPU, perhaps by
> asking it to do very CPU-intensive things, or by asking it to do things at
> a very high rate. You need to find out what the cause is.
>
>
> >An amateurish summary of these tests would be: there is
> something different
> >in 10.2. from 10.1. It couldn't be the JVM because, as far as I
> know, that
> >hasn't changed. However, it must be something to do with JAVA, because I
> >don't get this behaviour for non-Java applications.
>
> But Java DID change in 10.2. See the 10.2 Java release notes:
> <http://developer.apple.com/techpubs/macosx/ReleaseNotes/java10.2.html>
>
> Also see the previous release notes, where you might find a known issue
> that seems relevant:
> <http://developer.apple.com/techpubs/macosx/Java/java.html>
>
>
> >I have also tried profiling my app with the -Xprof option. It
> gives me heaps
> >of output - what exactly would I be looking for?
>
> Which method in which class is consuming the most amount of time in each
> thread. Each thread's output is sorted by time-consumption, i.e. which
> method consumes the most time for that thread is listed first, with it's
> percentage and the number of ticks (10 ms/tick, as I recall). You'll want
> to find the thread that's active the largest number of ticks, in addition
> to finding the largest consumer in that thread.
>
> One of the best ways to learn what -Xprof is telling you is to run it on
> simple programs with only one or two threads. For example, run some
> well-known benchmark programs with -Xprof, and see if the results
> correspond to what the benchmark is supposed to be measuring.
>
>
> >--> I don't agree that it's irrelevant. I know it is naive to believe in
> >"Write once, run anywhere", but it is working quite fine for me - except
> >for the MAC.
>
> "Write once, test everywhere" is more practical, I think. YMMV.
>
>
> >--> I wasn't intending to do anything like it. The problem is
> simply that I
> >am not an OS expert for the Macintosh (or for any other OS), but a JAVA
> >programmer, and I simply can't find a solution or a cause for my
> problem in
> >JAVA terms.
>
> You may not have to be an OS expert. But you probably will have to
> interpret the -Xprof output, which I think is pretty much the same across
> platforms. Also see 'man java' has to say about -Xprof, and what Sun's
> docs have to say.
>
> You might have to use the 'gdb' or 'jdb' or JSwat debuggers to find out
> exactly what you need to know.
>
> None of this entails becoming an OS expert. It's just part of
> cross-platform testing and debugging.
>
> -- GG
> _______________________________________________
> java-dev mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/java-dev
> Be sure to read the FAQ http://developer.apple.com/java/faq/
> before posting
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: AW: ScreenMenuBar Dead (!!!) Slow (From: Greg Guerin <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.