-Xprof test cases

As many of you remember, the flat profiler built into HotSpot (-Xprof) became unusably slow in the 5.0 release. It used to have a 10% or less impact on execution speed, but now it slows down the program by a factor of 5 or more. It seems this is finally being looked at, but test cases are needed. I can reproduce the problem with some of the JOGL demos, but since these require somewhat specialized graphics hardware, does anyone have any pure Java examples of this slowdown? JEmu2? Others? The smaller and more self-contained the test case the better.

Thanks.

[quote] JEmu2? Others? The smaller and more self-contained the test case the better.
[/quote]
I’ll see what I can do.

As for JEmu2, it basically runs fine with -Xprof, except for the Swing front-end: If I run it with front-end, it basically halts when drawing the GUI (it doesn’t get beyond drawing an empty, grey, unresponsive JFrame). If I run the emulator without front-end, it runs close to full-speed. Without front-end, no Swing is used, so using Swing or AWT seems to trigger the problem in my case.

I’ve seen similar behavior with some JOGL apps but it seems to be fixed in later 6 update releases. I’m running prerelease builds here, but if you still see this with the publicly-available 6u3, or the 6uN pre-release builds, let me know.

Anyway, appreciate it if you can provide a test case soon.

The 6uN build regularly causes pauses and mouse-freeze on my machine, like they’ve screwed the thread priorities again. Grr.

Cas :slight_smile:

Issue has been mentioned to the HotSpot runtime team.

Thanks Ken, I’d report it myself but I have a feeling they’ll listen to you a bit more attentively :wink:

Cas :slight_smile:

Sorry for necro-ing this thread, but is there any update on this?
-Xprof is still unusuable for swing applications.

For example, running the following with -Xprof results in a completely unresponsive program:


import java.awt.event.*;
import javax.swing.*;

public class Test {

    public static void main(String[] args) {
        
        final JFrame frame = new JFrame("Frame");
        JButton btn = new JButton("Click here");
        btn.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                JOptionPane.showMessageDialog(frame, "Clicked!", "Message", JOptionPane.WARNING_MESSAGE);
            }
        });
        frame.add(btn);
        frame.pack();
        frame.setVisible(true);        
    }
}

There is a bug report: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6618943 but it seems that it’s regarded as an RFE, but it looks like a bug to me.

EDIT:
Actually, there seems to be a workaround (-XX:SuspendRetryCount=2)…