[sip-comm-dev] Profiler4j


#1

Hi all,

As some of you may have notice, profiler4j is now integrated in SIP
Communicator thanks to the GSoC work of Vladimir. All of you can now use it
very simply by using the new ant target run-with-profiler. Once activated
you can launch the profiling windows by using the "Profiler4j" button in the
Settings menu. This should greatly help all of you who are interested in the
performance of your code but didn't want to spend time in setting up a
profiler.

Now you won't have any excuse if you produce some laggy code :slight_smile:

I'm not fully satisfied of the new ant target because it didn't delete the
bundle after the execution. I faced two problems here: what can we do if the
jvm crashes? and how to uninstall a bundle after the execution (when the
felix deployement directory is unknown)? For the second problem I envisage
two solution: The first one would be to force the deployement directory to a
fixed location and remove the directory at the end of the execution or, the
second solution, would be to create a new command line argument that tells
SIP Communicator to uninstall a bundle and to exit. What do you think ?

Please, report any bugs or problem that appear after updating.

By the way, the contribution will be acked when I'll find my wiki password
back...

Thanks,

Ben


#2

Hello,

Thank for integrating it, Ben! May be you can put the issues into the bug
tracking system and describe the steps you made (i.e. what are you doing for
jvm crash) ? I could help you with solving the issues when I finish a set
of homeworks at the University.

Good luck,
Vladimir

···

On Thu, Oct 2, 2008 at 5:26 AM, Benoit Pradelle <b.pradelle@gmail.com>wrote:

Hi all,

As some of you may have notice, profiler4j is now integrated in SIP
Communicator thanks to the GSoC work of Vladimir. All of you can now use it
very simply by using the new ant target run-with-profiler. Once activated
you can launch the profiling windows by using the "Profiler4j" button in the
Settings menu. This should greatly help all of you who are interested in the
performance of your code but didn't want to spend time in setting up a
profiler.

Now you won't have any excuse if you produce some laggy code :slight_smile:

I'm not fully satisfied of the new ant target because it didn't delete the
bundle after the execution. I faced two problems here: what can we do if the
jvm crashes? and how to uninstall a bundle after the execution (when the
felix deployement directory is unknown)? For the second problem I envisage
two solution: The first one would be to force the deployement directory to a
fixed location and remove the directory at the end of the execution or, the
second solution, would be to create a new command line argument that tells
SIP Communicator to uninstall a bundle and to exit. What do you think ?

Please, report any bugs or problem that appear after updating.

By the way, the contribution will be acked when I'll find my wiki password
back...

Thanks,

Ben


#3

Hi,

I've tried using the profiler on mac and on linux I found a little bug :slight_smile:
it cannot find the jar : [java] Error opening zip file: /Users/......../sip-communicator/lib/installer-exclude\profiler4j-1.0-beta3-SC.jar
If you correct
<param name="profiler.args" value="-Xmx128m -javaagent:\{lib\.noinst\}\\profiler4j\-1\.0\-beta3\-SC\.jar&quot; /&gt; to be &lt;param name=&quot;profiler\.args&quot; value=&quot;\-Xmx128m \-javaagent:{lib.noinst}/profiler4j-1.0-beta3-SC.jar" />
its OK :slight_smile: The problem is the last "\" in the path.

One more thing I got an exception on Mac and cannot run it at all, have you experience this, the Exception is :

     [java] [P4J:0:main]

···

+---------------------------------------------------+
     [java] [P4J:0:main] | Profiler4j Agent (SC integrated) |
     [java] [P4J:0:main] | Copyright 2006 Antonio S. R. Gomes |
     [java] [P4J:0:main] | See LICENSE-2.0.txt details |
     [java] [P4J:0:main] +---------------------------------------------------+
     [java] [P4J:0:main] Work dir set to /tmp/profiler4j.tmp
     [java] [P4J:0:main] Acquiring lock on work directory...
     [java] [P4J:0:main] Cleaning work directory...
     [java] [P4J:0:main] Lock acquired successfully
     [java] [P4J:0:main] Creating backup for already loaded classes...
     [java] [P4J:0:main] Could not initialize agent
     [java] [P4J:0:main] net.sf.profiler4j.agent.Profiler4JError: Could not find resource for class sun.reflect.GeneratedConstructorAccessor1
     [java] [P4J:0:main] at net.sf.profiler4j.agent.ClassUtil.loadClassBytesAsResource(ClassUtil.java:119)
     [java] [P4J:0:main] at net.sf.profiler4j.agent.Agent.doPreInitialization(Agent.java:138)
     [java] [P4J:0:main] at net.sf.profiler4j.agent.Agent.premain(Agent.java:79)
     [java] [P4J:0:main] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java] [P4J:0:main] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     [java] [P4J:0:main] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [java] [P4J:0:main] at java.lang.reflect.Method.invoke(Method.java:585)
     [java] [P4J:0:main] at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:141)

Cheers
damencho

Vladimir Shkarupelov wrote:

Hello,
Thank for integrating it, Ben! May be you can put the issues into the bug tracking system and describe the steps you made (i.e. what are you doing for jvm crash) ? I could help you with solving the issues when I finish a set of homeworks at the University.
Good luck,
Vladimir

On Thu, Oct 2, 2008 at 5:26 AM, Benoit Pradelle <b.pradelle@gmail.com > <mailto:b.pradelle@gmail.com>> wrote:

    Hi all,

    As some of you may have notice, profiler4j is now integrated in
    SIP Communicator thanks to the GSoC work of Vladimir. All of you
    can now use it very simply by using the new ant target
    run-with-profiler. Once activated you can launch the profiling
    windows by using the "Profiler4j" button in the Settings menu.
    This should greatly help all of you who are interested in the
    performance of your code but didn't want to spend time in setting
    up a profiler.

    Now you won't have any excuse if you produce some laggy code :slight_smile:

    I'm not fully satisfied of the new ant target because it didn't
    delete the bundle after the execution. I faced two problems here:
    what can we do if the jvm crashes? and how to uninstall a bundle
    after the execution (when the felix deployement directory is
    unknown)? For the second problem I envisage two solution: The
    first one would be to force the deployement directory to a fixed
    location and remove the directory at the end of the execution or,
    the second solution, would be to create a new command line
    argument that tells SIP Communicator to uninstall a bundle and to
    exit. What do you think ?

    Please, report any bugs or problem that appear after updating.

    By the way, the contribution will be acked when I'll find my wiki
    password back...

    Thanks,

    Ben

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#4

Hi Damian,

Thanks for reporting this, I'll change this slash orientation in the
build.xml asap. You can also commit the changes if you want to.

I'm not really used to develop on Mac but I'll try to solve the exception.
If any of you wants to help for this, your help would be highly appreciated
:).

Thanks,

Ben

···

2008/10/9 Damian Minkov <damencho@damencho.com>

Hi,

I've tried using the profiler on mac and on linux I found a little bug :slight_smile:
it cannot find the jar : [java] Error opening zip file:
/Users/......../sip-communicator/lib/installer-exclude\profiler4j-1.0-beta3-SC.jar
If you correct
<param name="profiler.args" value="-Xmx128m
-javaagent:${lib.noinst}\profiler4j-1.0-beta3-SC.jar" />
to be
<param name="profiler.args" value="-Xmx128m
-javaagent:${lib.noinst}/profiler4j-1.0-beta3-SC.jar" />
its OK :slight_smile: The problem is the last "\" in the path.

One more thing I got an exception on Mac and cannot run it at all, have you
experience this, the Exception is :

   [java] [P4J:0:main]
+---------------------------------------------------+
   [java] [P4J:0:main] | Profiler4j Agent (SC integrated)
>
   [java] [P4J:0:main] | Copyright 2006 Antonio S. R. Gomes
>
   [java] [P4J:0:main] | See LICENSE-2.0.txt details
>
   [java] [P4J:0:main]
+---------------------------------------------------+
   [java] [P4J:0:main] Work dir set to /tmp/profiler4j.tmp
   [java] [P4J:0:main] Acquiring lock on work directory...
   [java] [P4J:0:main] Cleaning work directory...
   [java] [P4J:0:main] Lock acquired successfully
   [java] [P4J:0:main] Creating backup for already loaded classes...
   [java] [P4J:0:main] Could not initialize agent
   [java] [P4J:0:main] net.sf.profiler4j.agent.Profiler4JError: Could not
find resource for class sun.reflect.GeneratedConstructorAccessor1
   [java] [P4J:0:main] at
net.sf.profiler4j.agent.ClassUtil.loadClassBytesAsResource(ClassUtil.java:119)
   [java] [P4J:0:main] at
net.sf.profiler4j.agent.Agent.doPreInitialization(Agent.java:138)
   [java] [P4J:0:main] at
net.sf.profiler4j.agent.Agent.premain(Agent.java:79)
   [java] [P4J:0:main] at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   [java] [P4J:0:main] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   [java] [P4J:0:main] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   [java] [P4J:0:main] at
java.lang.reflect.Method.invoke(Method.java:585)
   [java] [P4J:0:main] at
sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:141)

Cheers
damencho

Vladimir Shkarupelov wrote:

Hello,
Thank for integrating it, Ben! May be you can put the issues into the bug
tracking system and describe the steps you made (i.e. what are you doing for
jvm crash) ? I could help you with solving the issues when I finish a set
of homeworks at the University.
Good luck,
Vladimir
On Thu, Oct 2, 2008 at 5:26 AM, Benoit Pradelle <b.pradelle@gmail.com<mailto: >> b.pradelle@gmail.com>> wrote:

   Hi all,

   As some of you may have notice, profiler4j is now integrated in
   SIP Communicator thanks to the GSoC work of Vladimir. All of you
   can now use it very simply by using the new ant target
   run-with-profiler. Once activated you can launch the profiling
   windows by using the "Profiler4j" button in the Settings menu.
   This should greatly help all of you who are interested in the
   performance of your code but didn't want to spend time in setting
   up a profiler.

   Now you won't have any excuse if you produce some laggy code :slight_smile:

   I'm not fully satisfied of the new ant target because it didn't
   delete the bundle after the execution. I faced two problems here:
   what can we do if the jvm crashes? and how to uninstall a bundle
   after the execution (when the felix deployement directory is
   unknown)? For the second problem I envisage two solution: The
   first one would be to force the deployement directory to a fixed
   location and remove the directory at the end of the execution or,
   the second solution, would be to create a new command line
   argument that tells SIP Communicator to uninstall a bundle and to
   exit. What do you think ?

   Please, report any bugs or problem that appear after updating.

   By the way, the contribution will be acked when I'll find my wiki
   password back...

   Thanks,

   Ben

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#5

Hi Damian,

As you may have noticed I've commited a little patch that may fix the bug on
Mac. Could you please tell me if the bug is still present?

Thanks,

Ben

···

2008/10/9 Damian Minkov <damencho@damencho.com>

Hi,

I've tried using the profiler on mac and on linux I found a little bug :slight_smile:
it cannot find the jar : [java] Error opening zip file:
/Users/......../sip-communicator/lib/installer-exclude\profiler4j-1.0-beta3-SC.jar
If you correct
<param name="profiler.args" value="-Xmx128m
-javaagent:${lib.noinst}\profiler4j-1.0-beta3-SC.jar" />
to be
<param name="profiler.args" value="-Xmx128m
-javaagent:${lib.noinst}/profiler4j-1.0-beta3-SC.jar" />
its OK :slight_smile: The problem is the last "\" in the path.

One more thing I got an exception on Mac and cannot run it at all, have you
experience this, the Exception is :

   [java] [P4J:0:main]
+---------------------------------------------------+
   [java] [P4J:0:main] | Profiler4j Agent (SC integrated)
>
   [java] [P4J:0:main] | Copyright 2006 Antonio S. R. Gomes
>
   [java] [P4J:0:main] | See LICENSE-2.0.txt details
>
   [java] [P4J:0:main]
+---------------------------------------------------+
   [java] [P4J:0:main] Work dir set to /tmp/profiler4j.tmp
   [java] [P4J:0:main] Acquiring lock on work directory...
   [java] [P4J:0:main] Cleaning work directory...
   [java] [P4J:0:main] Lock acquired successfully
   [java] [P4J:0:main] Creating backup for already loaded classes...
   [java] [P4J:0:main] Could not initialize agent
   [java] [P4J:0:main] net.sf.profiler4j.agent.Profiler4JError: Could not
find resource for class sun.reflect.GeneratedConstructorAccessor1
   [java] [P4J:0:main] at
net.sf.profiler4j.agent.ClassUtil.loadClassBytesAsResource(ClassUtil.java:119)
   [java] [P4J:0:main] at
net.sf.profiler4j.agent.Agent.doPreInitialization(Agent.java:138)
   [java] [P4J:0:main] at
net.sf.profiler4j.agent.Agent.premain(Agent.java:79)
   [java] [P4J:0:main] at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   [java] [P4J:0:main] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   [java] [P4J:0:main] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   [java] [P4J:0:main] at
java.lang.reflect.Method.invoke(Method.java:585)
   [java] [P4J:0:main] at
sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:141)

Cheers
damencho

Vladimir Shkarupelov wrote:

Hello,
Thank for integrating it, Ben! May be you can put the issues into the bug
tracking system and describe the steps you made (i.e. what are you doing for
jvm crash) ? I could help you with solving the issues when I finish a set
of homeworks at the University.
Good luck,
Vladimir
On Thu, Oct 2, 2008 at 5:26 AM, Benoit Pradelle <b.pradelle@gmail.com<mailto: >> b.pradelle@gmail.com>> wrote:

   Hi all,

   As some of you may have notice, profiler4j is now integrated in
   SIP Communicator thanks to the GSoC work of Vladimir. All of you
   can now use it very simply by using the new ant target
   run-with-profiler. Once activated you can launch the profiling
   windows by using the "Profiler4j" button in the Settings menu.
   This should greatly help all of you who are interested in the
   performance of your code but didn't want to spend time in setting
   up a profiler.

   Now you won't have any excuse if you produce some laggy code :slight_smile:

   I'm not fully satisfied of the new ant target because it didn't
   delete the bundle after the execution. I faced two problems here:
   what can we do if the jvm crashes? and how to uninstall a bundle
   after the execution (when the felix deployement directory is
   unknown)? For the second problem I envisage two solution: The
   first one would be to force the deployement directory to a fixed
   location and remove the directory at the end of the execution or,
   the second solution, would be to create a new command line
   argument that tells SIP Communicator to uninstall a bundle and to
   exit. What do you think ?

   Please, report any bugs or problem that appear after updating.

   By the way, the contribution will be acked when I'll find my wiki
   password back...

   Thanks,

   Ben

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net