The Source for Java Technology Collaboration

Home » java.net Forums » Phone ME » phoneME Advanced software

Thread: Java Virtual Machine Statistics Monitoring Tool on phoneME Advanced

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
This question is answered.

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 13 - Last Post: Apr 6, 2008 5:35 PM by: stogawa Threads: [ Previous | Next ]
stogawa

Posts: 8
Java Virtual Machine Statistics Monitoring Tool on phoneME Advanced
Posted: Jan 15, 2008 5:05 PM
 
  Click to reply to this thread Reply

Hello.

I'm using phoneME Advanced MR1 (CDC) on Linux/sh3.

I want to monitor Java VM statistics (for example, capacity and utilization of heaps).
Are there tools that can monitor Java VM from outside of VM (like to jstat or jvmstat on J2SE) ?

I want to add a VM management function that can manage get capacity and utilization of heaps.
On J2SE, Java VM has class PerfCounter, and jstat generates return values from this class.
Has anyone made it yet?

When implementing this function, It seems to need to modify shared code.
Should I modify shared code for this function individually?
Do some developers have plan to support it?

I cannot use profiler on emulators on WTK.
Because I want to use CDC (not CLDC),
and my Java applications use JNI functions specialized to some I/O devices.

Thank you.

mlam

Posts: 44
Re: Java Virtual Machine Statistics Monitoring Tool on phoneME Advanced
Posted: Jan 15, 2008 5:31 PM   in response to: stogawa
Helpful
  Click to reply to this thread Reply

Hi stogawa,

There isn't any plan to add jstat support yet. Just so you know, there is a CDC toolkit (i.e. WTK for CDC) that is powered by CVM as well. See http://java.sun.com/products/cdctoolkit/download-1_0.html.

Have you tried downloading the latest SVN development trunk of phoneME Advanced? The latest trunk includes support for JVMTI. With that, you should be able to run with the NetBeans profiler and many other JavaSE profiler tools that runs on JVMTI. You can also write your own JVMTI tool if that's what you want to do.

If you still think that you need to modify shared code (or any VM code), can you please provide some details on the nature of the modification? If it is really necessary, we can help you get signed up as a contributor and walk you through the process of becoming an open source contributor to this project. :) Of course, you can still do that even if you don't need to modify the VM code.

Mark

xingri

Posts: 1
Re: Java Virtual Machine Statistics Monitoring Tool on phoneME Advanced
Posted: Jan 28, 2008 2:48 AM   in response to: mlam
 
  Click to reply to this thread Reply

Hi Mark,

We are trying to use NetBeans IDE 6.0 for remote profiler with JVMTI supported by phoneME Advanced on Linux/MIPS platform.
The NetBeans's JVMTI agent was built successfully with only one modification: the "Agent_OnUnload()" function was added to the agent sources as phoneME Advanced(for MIPS) requires.
However, the "jfluid-server.jar" requires some classes, which are not present in phoneME Advanced; it requires "java.util.logging" and "java.util.concurrent" packages.

So, my questions are ;
1. Do we need to add some packages to phoneME Advanced? If then, what packages will be added exactly? Can we use these packages ("java.util.logging" and "java.util.concurrent") from of J2SE 1.6 or 1.5?
2. Or do we just we Netbeans mobility package with phoneME Advanced? If so, which version of Netbeans mobility pakage do we need to use?

Kind regards,
Byungseon.

mlam

Posts: 44
Re: Java Virtual Machine Statistics Monitoring Tool on phoneME Advanced
Posted: Jan 28, 2008 11:06 AM   in response to: xingri
 
  Click to reply to this thread Reply

Hi Byungseon,

To my knowledge, NetBeans should work with CVM without the addition of additional Java APIs to phoneME Advanced. However, I'm not the expert. I'll see if my colleague (who is the expert on JVMTI) can provide some details here on how to use NetBeans with CVM.

Regards,
Mark

billp

Posts: 24
Re: Java Virtual Machine Statistics Monitoring Tool on phoneME Advanced
Posted: Feb 6, 2008 5:24 PM   in response to: xingri
Helpful
  Click to reply to this thread Reply

The changes needed to run the Netbeans 6.x profiler against CVM did not make it in to the 6.0 branch. I've sent an email to the Netbeans team to see if the changes will be going into the 6.1 trunk. I'll keep you posted.

bill

stogawa

Posts: 8
Re: Java Virtual Machine Statistics Monitoring Tool on phoneME Advanced
Posted: Mar 13, 2008 12:23 AM   in response to: stogawa
 
  Click to reply to this thread Reply

Hi All,

I tried to use NetBeans profiler by phoneME Advanced MR2 b53 on Linux-x86-generic platform. I got netbeans-6.0.1-200801291616-ml-profiler.zip.
But I got some errors.

When I execute below, an error has occurred.
----
#!/bin/sh

NB_DIR="/home/togawa/work/netbeans/profiler2"
JAR_DIR=${NB_DIR}/lib

./cvm \
-classpath .:${JAR_DIR}/jfluid-server.jar:${JAR_DIR}/jfluid-server-15.jar \
-agentpath:"${NB_DIR}/lib/deployed/jdk15/linux/libprofilerinterface.so"="\"${NB_DIR}/lib\"",5140 \
Hello
----
And I executed this
----
$ cd /home/togawa/work/netbeans/profiler2/lib/deployed
$ ln -s jdk15 UNSUPPORTED_JDK
----
And another error occored.
----
[togawa@trece03 bin]$ ./netbeans
Profiler Agent: Initializing...
Profiler Agent: Options: >"/home/togawa/work/netbeans/profiler2/lib",5140<
Profiler Agent: Initialized succesfully
Profiler Agent: Waiting for connection on port 5140 (Protocol version: 8)

(Executed NetBeans on another machine, and attached profiler)

Profiler Agent: Established remote connection with the tool
Profiler initialization failed due to:
java.lang.NoClassDefFoundError: java.lang.management.ManagementFactory
at org.netbeans.lib.profiler.server.system.Timers.initialize(Timers.java:84)
at org.netbeans.lib.profiler.server.ProfilerInterface.initProfilerInterface(ProfilerInterface.java:459)
at org.netbeans.lib.profiler.server.ProfilerServer.initSupportingFunctionality(ProfilerServer.java:973)
at org.netbeans.lib.profiler.server.ProfilerServer.doActivate(ProfilerServer.java:904)
at org.netbeans.lib.profiler.server.ProfilerServer.activate(ProfilerServer.java:512)
----
I think that this error is different from Byungseon's one.

When I re-compile NetBeans remote profiler, can I refuse this error?

Regards,
Togawa

Hinkmond Wong
Re: Java Virtual Machine Statistics Monitoring Tool on phoneME Advanced
Posted: Mar 13, 2008 5:51 PM   in response to: stogawa
  Click to reply to this thread Reply

phonemeadvanced@mobileandembedded.org wrote:
> Hi All,
>
> I tried to use NetBeans profiler by phoneME Advanced MR2 b53 on Linux-x86-generic platform. I got netbeans-6.0.1-200801291616-ml-profiler.zip.
> But I got some errors.
>
> When I execute below, an error has occurred.
> ----
> #!/bin/sh
>
> NB_DIR="/home/togawa/work/netbeans/profiler2"
> JAR_DIR=${NB_DIR}/lib
>
> ./cvm \
> -classpath .:${JAR_DIR}/jfluid-server.jar:${JAR_DIR}/jfluid-server-15.jar \
> -agentpath:"${NB_DIR}/lib/deployed/jdk15/linux/libprofilerinterface.so"="\"${NB_DIR}/lib\"",5140 \
> Hello
> ...
> And another error occored.
> ----
> [togawa@trece03 bin]$ ./netbeans
> ...
> Profiler Agent: Established remote connection with the tool
> Profiler initialization failed due to:
> java.lang.NoClassDefFoundError: java.lang.management.ManagementFactory
> at org.netbeans.lib.profiler.server.system.Timers.initialize(Timers.java:84)
>
Hi Togawa

phoneME Advanced does not have java.lang.management.* as part of its
spec. So, this might be a question you have to ask someone from the
NetBeans project.

Does the NetBeans 6.0 Profiler run with Java ME CDC (phoneME Advanced)?

It looks like from the error message above that the NetBeans Profiler
does not run with Java ME CDC. But, there may be a NetBeans
configuration setting that I don't know about that someone from the
NetBeans side could answer for you.


Hinkmond




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


billp

Posts: 24
Re: Java Virtual Machine Statistics Monitoring Tool on phoneME Advanced
Posted: Mar 13, 2008 7:43 PM   in response to: stogawa
Correct
  Click to reply to this thread Reply

The current Netbeans profiler codebase does not support PhoneME Advanced "out of the box". We are working with the Netbeans team to address this. The VM itself does have JVMTI profiling support in it and you can use the jvmtihprof demo tool that is in the phoneMe advanced source tree. We will keep this forum posted on any progress with the Netbeans profiler

Hinkmond Wong
Re: Java Virtual Machine Statistics Monitoring Tool on phoneME Advanced
Posted: Mar 14, 2008 6:37 PM   in response to: billp
  Click to reply to this thread Reply

phonemeadvanced@mobileandembedded.org wrote:
> The current Netbeans profiler codebase does not support PhoneME Advanced "out of the box". We are working with the Netbeans team to address this. The VM itself does have JVMTI profiling support in it and you can use the jvmtihprof demo tool that is in the phoneMe advanced source tree. We will keep this forum posted on any progress with the Netbeans profiler
>

Thanks, Bill! :-)

Hinkmond

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


stogawa

Posts: 8
Re: Java Virtual Machine Statistics Monitoring Tool on phoneME Advanced
Posted: Mar 16, 2008 6:38 PM   in response to: billp
 
  Click to reply to this thread Reply

Thank you, Bill!
I'll use jvmtihprof to test JVMTI.

stogawa

Posts: 8
Re: Java Virtual Machine Statistics Monitoring Tool on phoneME Advanced
Posted: Apr 3, 2008 6:50 PM   in response to: billp
 
  Click to reply to this thread Reply

I tried to run jvmtihprof on Linux/x86.

1st, a script below success, and a profile file "java.hprof.txt" is outputted.
----
#!/bin/sh

LIBDIR=/home/togawa/work/phoneme/phoneme_advanced-mr2-dev-b53/cdc/build/linux-x86-generic/lib

./cvm \
-agentpath:${LIBDIR}/libjvmtihprof.so \
-Xbootclasspath/a:${LIBDIR}/java_crw_demo.jar \
Hello
----
2nd, a script below success, but a profile file is not outputted.
----
#!/bin/sh

LIBDIR=/home/togawa/work/phoneme/phoneme_advanced-mr2-dev-b53/cdc/build/linux-x86-generic/lib

./cvm \
-Xrunjvmtihprof \
-Xbootclasspath/a:${LIBDIR}/java_crw_demo.jar \
Hello
----
So I wonder that:
1. Can I add some hprof options (for example "help") in 1st sctipt?
2. 2nd script is correct?

Hinkmond Wong
Re: Java Virtual Machine Statistics Monitoring Tool on phoneME Advanced
Posted: Apr 4, 2008 9:51 AM   in response to: stogawa
  Click to reply to this thread Reply

phonemeadvanced@mobileandembedded.org wrote:
> I tried to run jvmtihprof on Linux/x86.
>
> 1st, a script below success, and a profile file "java.hprof.txt" is outputted.
> ----
> #!/bin/sh
>
> LIBDIR=/home/togawa/work/phoneme/phoneme_advanced-mr2-dev-b53/cdc/build/linux-x86-generic/lib
>
> ./cvm \
> -agentpath:${LIBDIR}/libjvmtihprof.so \
> -Xbootclasspath/a:${LIBDIR}/java_crw_demo.jar \
> Hello
> ----
> 2nd, a script below success, but a profile file is not outputted.
> ----
> #!/bin/sh
>
> LIBDIR=/home/togawa/work/phoneme/phoneme_advanced-mr2-dev-b53/cdc/build/linux-x86-generic/lib
>
> ./cvm \
> -Xrunjvmtihprof \
> -Xbootclasspath/a:${LIBDIR}/java_crw_demo.jar \
> Hello
> ----
> So I wonder that:
> 1. Can I add some hprof options (for example "help") in 1st sctipt?
> 2. 2nd script is correct?
>

Hi stogawa,

Bill P. is the best person to help you with your questions. But, I'm
sending you links to JVMTI info in case you don't have it already:

http://java.sun.com/j2se/1.5.0/docs/guide/jvmti/jvmti.html
http://java.sun.com/developer/technicalArticles/Programming/jvmti/


Hinkmond



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


billp

Posts: 24
Re: Java Virtual Machine Statistics Monitoring Tool on phoneME Advanced
Posted: Apr 4, 2008 10:24 AM   in response to: stogawa
 
  Click to reply to this thread Reply

jvmtihprof is only supported via the -agentlib or -agentpath options, so the 1st script
you have is the correct one. To get the help printout run like so:
/cvm \
-agentpath:${LIBDIR}/libjvmtihprof.so=help \
-Xbootclasspath/a:${LIBDIR}/java_crw_demo.jar \
Hello


bill

stogawa

Posts: 8
Re: Java Virtual Machine Statistics Monitoring Tool on phoneME Advanced
Posted: Apr 6, 2008 5:35 PM   in response to: billp
 
  Click to reply to this thread Reply

Hi, Bill.

I success it with "help" and "cpu=samples" options.
Thank you!




 XML java.net RSS