This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Howto: Profiling GCJ code?
- From: Bryce McKinlay <bmckinlay at gmail dot com>
- To: Patrick Schäfer <ps at ekse dot de>
- Cc: java at gcc dot gnu dot org
- Date: Fri, 19 Jun 2009 10:47:24 +0100
- Subject: Re: Howto: Profiling GCJ code?
- References: <89D1A14F-5454-4E48-8F99-8EAD9C2066A1@ekse.de>
The tool of choice for libgcj profiling is oprofile:
http://oprofile.sourceforge.net/
This should give you reasonably accurate, low-overhead profiling
without having to recompile anything, and even a call graph though
both the java and C/C++ code.
It doesn't surprise me that libgcj's java.nio is slow. Hotspot VMs can
also optimize nio code in ways that gcj can't.
Bryce
On Fri, Jun 19, 2009 at 9:52 AM, Patrick Schäfer<ps@ekse.de> wrote:
> Hi,
>
> I am trying to run a server based on apache mina (java.nio) and jna for
> native library access. The program runs just fine under jdk 1.5. But there
> is a massive performance breakdown using gcj. The program basically polls a
> Posix Message Queue every 500ms using JNA (JNI). This causes 5% cpu load on
> jdk but the load goes up to 100% using gcj.
>
> Is there any profiling tool which can be easily installed and applied to the
> native code?
>
> I read about profiling gcj applications on your faq. There are 3 tools
> mentioned. To my understanding gprof can't be applied due to missing
> multithreading support and it requires the program to exit main before
> writing any profiling information. The later is not easy when using a
> network server. cprof seems to be quite outdated (there has been no realease
> within the last years) and trying to "make" it, fails with several errors. I
> don't know about sprof, but I couldn't find much information about it on the
> internet.
>
> Thank you for any hints about current multithreading gcj (gcc) profilers
>
> Patrick
>